Ticket #6673 (closed bug: fixed)
Autocomplete combobox is not working in IE if value and name is different
| Reported by: | guoicq | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.8.7 |
| Component: | ui.autocomplete | Version: | 1.8.6 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The combobox is not working in IE8 if the value is different with the name displayed in the dropdown.
How to re-produce:
- Use the following dropdown below:
<select id="user">
<option value="">--</option> <option value="1">Eric</option> <option value="7">Tom</option>
</select>
The value (user id) above is different with the name (user name).
- The other part is the same as in the page
http://jqueryui.com/demos/autocomplete/#combobox
- Open IE, type "T" in the textbox, the autocomplete will display, select "Tom" by click on it. The textbox will display "Tom".
- Move focus to some other place so textbox lost focus.
The textbox will become blank! and the underline dropdown item 7 was not selected.
- The bug can be fixed by change the matching
if ( this.value.match( matcher ) ) { to if ( this.innerHTML.match( matcher ) ) {
Check out here: https://github.com/guoicq/jquery-ui/commit/ba9fee04c9aacef0dbb888693c79b035bbb3f3b5
Thanks
Charles
Change History
comment:1 Changed 2 years ago by scott.gonzalez
- Component changed from [meta] ui.demos to ui.autocomplete
comment:2 Changed 2 years ago by Scott González
- Status changed from new to closed
- Resolution set to fixed
Autocomplete: Use the text of the option, not the value when checking for valid values. Fixes #6673 - Autocomplete combobox is not working in IE if value and name is different.
Changeset: ddf59462af7fb986bb06c0b6d0101086b0702f5b

