#5775 closed bug (fixed)
Change event for Autocomplete Combobox does not work in IE7
Reported by: | james | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.8.3 |
Component: | ui.autocomplete | Version: | 1.8.2 |
Keywords: | ie7, autocomplete, change, onchange, change event | Cc: | |
Blocked by: | Blocking: |
Description
The demo code for the autocomplete combobox uses the change event to set the underlying select input elements value:
http://jqueryui.com/demos/autocomplete/#combobox
This works fine in firefox, but does not work in IE7. Below is an excerpt of the code:
change: function(event, ui) {
if (!ui.item) {
remove invalid value, as it didn't match anything jQuery(this).val(""); return false;
} select.val(ui.item.id); self._trigger("selected", event, { item: select.find("[value='" + ui.item.id + "']")
});
I have worked around this bug by using the selecte event. Either the demo code needs fixing, or more likely: the change event needs testing in IE7.
Cheers.
Change History (3)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Milestone: | TBD → 1.9 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in ba09165.
comment:3 Changed 13 years ago by
Milestone: | 1.9 → 1.8.3 |
---|
The same happens on IE8 using the mouse to select an item. The change event does not fire because the self.previous value is updated before the call to _change.
On the menu selected event there is some code to return the focus to the autocomplete input while keeping the self.previous value unchanged:
This code works, but after this there is another focus.autocomplete event that changes the self.previous value, breaking the change event on IE.
I've been unable to find where the second focus event comes from.