Ticket #6221 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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.

Change History

comment:1 follow-up: ↓ 2 Changed 4 years ago by reidres

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

comment:2 in reply to: ↑ 1 Changed 4 years ago by reidres

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.

comment:3 Changed 3 years ago by scott.gonzalez

  • Status changed from new to closed
  • Summary changed from Doesn't reset after Select when textbox cleared, if same letters typed in rapidly; source function not triggered in that case to Autocomplete: Doesn't reset after Select when textbox cleared, if same letters typed in rapidly; source function not triggered in that case
  • Resolution set to fixed
  • Milestone changed from TBD to 1.9

Fixed in  5c67ed2.

comment:4 Changed 3 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.6

comment:5 Changed 3 years ago by Scott González

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

Note: See TracTickets for help on using tickets.