#6093·bootstrap

Typeahead : late update of typeahead-no-results variable

Author: alexis-allotCreated Jul 16, 2016Updated Nov 28, 2018
Labelstype: enhancementcomponent: typeaheadPRs plz!

Bug description:

The typeahead-no-results variable is true while typing a string that will have autocomplete results, which is confusing to the user.

Example :

I am using typeahead-wait-ms to set a waiting period of 500ms

  1. I enter the string "z" (that will return no hits). The typeahead waits 500ms, then runs the query, then the variable typeahead-no-results is set to true and my custom message is shown to the user.
  2. The user deletes the string "z". typeahead-no-results is still true, and my message is still shown.
  3. The user enters the string "a" (that will produce hits). During the 500ms waiting my not-found message is still shown as typeahead-no-results is still true.
  4. Only when the request to the server is started typeahead-no-results becomes false and my message is hidden

Maybe typeahead-no-results should be reset on every keyup ?