Closed mjradwin closed 4 months ago
interesting
i may be missing something but isn't suggestionsThreshold enough to deal with this? maybe this could be checked in order to avoid unecessary queries
can you explain when this would be needed? when using suggestionsThreshold _shouldShow will return false if below that length and no query will be made
Thanks for the feedback here. It looks like the root cause of the problem was a race condition on focus handler. I had a focus handler that set the autocomplete input field to the empty string, which is firing at the same time as your focus handler (which in turn calls showOrSearch()
). Indeed, we don't need this pull request after all. Closing this as unneeded.
This PR adds a new
noEmptyQuery
option (defaultfalse
) that suppresses the fetch from remote when the autocomplete input field is empty. Most useful when usingliveServer
and trying to reduce network traffic.