#5719 closed bug (notabug)
Autocomplete: no-longer able to clear field value in change:
Reported by: | netnak | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.autocomplete | Version: | 1.8.2 |
Keywords: | autocomplete, clear, change | Cc: | |
Blocked by: | Blocking: |
Description
With version 1.8, clearing an input field after an autocomplete selection in the "change:" event worked fine.
In version 1.8.2 the field has to lose focus before the field value is cleared.
Which is the correct behaviour?
$(function(){
var tags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"]; $("#selector").autocomplete({
source: tags,
select: function(e, ui) {
var selectedvalue = ui.item.value;
$("#selection").html(selectedvalue);
},
change: function() {
$("#selector").val("");
}
});
});
Note: See
TracTickets for help on using
tickets.
The current behavior is intended. You can get the previous behavior by clearing the text field and canceling the select event. In the future, if you're unsure if something is a bug, please use the forums.