Opened 6 years ago

Closed 6 years ago

#9740 closed bug (duplicate)

Autocomplete doesn't keep its internal state consistent with jQuery val calls

Reported by: emmerich Owned by:
Priority: minor Milestone: none
Component: ui.autocomplete Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by tj.vantoll)

Manipulating the contents of an input element with an autocomplete field attached using jQuery.val does not update the autocomplete's internal "term" variable.

JSFiddle here: http://jsfiddle.net/qbwdm/

Reproduction steps:

  • Type "Hello" into the input box
  • Wait for the drop-down
  • Press enter
  • Value is cleared, drop-down disappears
  • Select the input box
  • Type "Hello" again (fairly quickly)

Expected:

  • Drop-down appears with the correct options

Actual:

  • Drop-down doesn't appear

It's because the check in the _searchTimeout (if(this.term !== this._value()) fails, as the internal value was not updated when the .val("") call was made.

Change History (3)

comment:1 Changed 6 years ago by emmerich

Apologies, the ticket seems to has lost some of my formatting around the repro steps.

comment:2 Changed 6 years ago by tj.vantoll

Description: modified (diff)

comment:3 Changed 6 years ago by tj.vantoll

Resolution: duplicate
Status: newclosed

Duplicate of #7434.

Note: See TracTickets for help on using tickets.