Skip to main content

Search and Top Navigation

#6221 closed bug (fixed)

Opened October 24, 2010 03:03AM UTC

Closed October 25, 2010 02:02PM UTC

Last modified November 19, 2010 06:26PM UTC

Autocomplete: Doesn't reset after Select when textbox cleared, if same letters typed in rapidly; source function not triggered in that case

Reported by: reidres Owned by:
Priority: trivial Milestone: 1.8.6
Component: ui.autocomplete Version: 1.8.5
Keywords: Cc:
Blocked by: Blocking:
Description

Observed using IE 8. Setting: minLength: 2

I am using a single textbox / autocomplete to create a list. The list is handled outside of the textbox autocomplete functionality, except that I have autocomplete's Select functionality send it outside of textbox and autocomplete.

I am returning false from the ''Select'' function. And within the Select function I am clearing the textbox (setting to "").

Imagine I want to select John Smith the first time and John Doe the second time. I type in "jo" and the ''source'' function is triggered. I then select John Smith. It goes fine. The ''Select'' function is triggered and clears the textbox. Then I again type in "jo" with a fast typing speed. In this case the ''source'' function is not triggered. If instead I type in "jo" with a slow typing speed, the ''source'' function is triggered. If I instead type in "su" or any other two letters at a fast or slow speed, the ''source'' function is triggered.

I am working around this by putting my initializing source and Select functions in a reset function and in my Select function I am using the AutoComplete destroy method and then calling my reset function.

Maybe this is not a bug but I am submitting it in case it is.

Attachments (0)
Change History (5)

Changed October 24, 2010 09:01AM UTC by reidres comment:1

I see I can duplicate a similar issue the demo: http://docs.jquery.com/Plugins/autocomplete.

(1) type in a lowercase c; results pop up

(2) click right next to that textbox where it says "API"

(3) return to the textbox and select the c

(4) press the delete key on your keyboard

(5) re-enter a c; nothing pops up

Changed October 24, 2010 06:32PM UTC by reidres comment:2

OK, I will state that the issue concerns the UI and not the plugin version, though the plugin has a similar issue apparently. And the UI demo does not have the issue that I show in steps 1-5 above. Nonetheless, the 1.8.5 UI autocomplete does have the issue I state in the original posting.

Changed October 25, 2010 02:02PM UTC by scottgonzalez comment:3

milestone: TBD1.9
resolution: → fixed
status: newclosed
summary: Doesn't reset after Select when textbox cleared, if same letters typed in rapidly; source function not triggered in that caseAutocomplete: Doesn't reset after Select when textbox cleared, if same letters typed in rapidly; source function not triggered in that case

Fixed in 5c67ed2.

Changed October 25, 2010 07:01PM UTC by scottgonzalez comment:4

milestone: 1.91.8.6

Changed November 19, 2010 06:26PM UTC by Scott González comment:5

Autocomplete: Always reset this.term after a select event, even if the select is cancelled. Fixes #6221 - Autocomplete: Doesn't reset after Select when textbox cleared, if same letters typed in rapidly; source function not triggered in that case.

Changeset: 5c67ed26e8c36c42c9f149fcfb2f5fe9e1192b26