Search and Top Navigation
#9329 closed bug (duplicate)
Opened May 24, 2013 08:34PM UTC
Closed May 24, 2013 09:12PM UTC
Autocomplete: Does not display when searching for the same string with a delay
| Reported by: | garygreen | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | none |
| Component: | ui.autocomplete | Version: | 1.10.3 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
It's due to the if statement in the following lines of code:
_searchTimeout: function( event ) {
clearTimeout( this.searching );
this.searching = this._delay(function() {
// only search if the value has changed
if ( this.term !== this._value() ) {
this.selectedItem = null;
this.search( null, event );
}
}, this.options.delay );
},
This means that it won't re-display the options if the input is reentered. Try the below fiddle by typing "london" and waiting for the display, click away, re-enter "london" and it won't display.
Attachments (0)
Change History (2)
Changed May 24, 2013 09:11PM UTC by comment:1
| status: | new → open |
|---|---|
| summary: | .autocomplete() not searching on same input when using delay → Autocomplete: Does not display when searching for the same string with a delay |
Here's the same test case with the CSS added: http://jsfiddle.net/tj_vantoll/JeBpz/. This could be especially problematic if there are other potential matches (for example "london2", "london bridge", etc).
I don't ''think'' we have to run the search again here, we could probably just add an else that displays the menu, since it should be in the same state as before.