afcapel / stimulus-autocomplete

Stimulus autocomplete component
MIT License
478 stars 61 forks source link

Doublecheck the input length at the last moment #137

Open duffyjp opened 1 year ago

duffyjp commented 1 year ago

I've had issues where deleting characters in the input field faster than the server is responding to queries can leave old results on screen, even if the entire field is cleared. It largely occurs when holding the backspace key and releasing either exactly when no characters exist or while the count is < the minLength. The issue is most noticeable if your data-autocomplete-delay-value is set very low (mine is 11).

Things that didn't work:

What did work:

Why it works (AFAIK):

Example:

Before After
stimulus-autocomplete-main 2023-06-05 16_00_58 stimulus-autocomplete-update 2023-06-05 16_02_07
netlify[bot] commented 1 year ago

Deploy Preview for stimulus-autocomplete canceled.

Name Link
Latest commit c12cc0045ebe7af95699c800c4d810c9d104c482
Latest deploy log https://app.netlify.com/sites/stimulus-autocomplete/deploys/647e4ffc07a8800008a23f59