Skip to content

Commit

Permalink
[TASK] show label instead of value on autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
kaystrobach committed Jan 12, 2016
1 parent bc5f7e1 commit 698ed69
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Resources/Public/JavaScript/main2.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
});

$(settings.formfield).on(
'keydown',
'keyup',
function(event) {
var text = $(settings.formfield).val();
if(event.which === 13) {
Expand Down Expand Up @@ -219,16 +219,19 @@
} else {
addValueAutocomplete(element);
}
$(element).val('');
window.setTimeout(function() {
// @todo add handling for disabled autocomplete
//if(ui.item.configuration.freeInput) {
// $(element).autofocus('disable');
//}
$(element).val('');
$(element).focus();
}, 50);

return false;
},
focus: function (event, ui) {
event.preventDefault();
$(this).val(ui.item.label);
}
}
);
Expand Down

0 comments on commit 698ed69

Please sign in to comment.