giellatekno / neahttadigisanit

Saami dictionary webapp
Other
2 stars 2 forks source link

Autocomplete shows multiple result lists #28

Closed trondtynnol closed 4 months ago

trondtynnol commented 4 months ago

Sometimes if I write quickly, especially if I delete a character and then write another, two lists of suggestions appear.

In the following example I first typed "sama", then quickly deleted the a and wrote "sami" instead. As seen, the result is first the autocomplete for "sam" and then for "sami". When tabbing through this list, it jumps between the two. For the following picture, the tab moves as follows: samai > sami > samarianeǩ > sami pueʹrr > samasvetnai > sami šiõǥǥ > samasveâtnai and then continues down the upper list. image

Phaqui commented 4 months ago

I can't replicate this locally, because there is no delay to the server. The issue is that an autocomplete request does not come back before another one is sent. The handler that runs when the request comes back does not clear out the suggestion list - it only appends to them (and the clearing out is done when the request is sent). However, the simple solution should be to just abort the autocomplete request if one is in progress when another one should start.

Phaqui commented 4 months ago

Fixed as of 10b30c6d315917acc813dd21352f3289f9ff449a

... At least I cannot reproduce it on the server anymore - maybe your fingers are faster than mine! :)

trondtynnol commented 4 months ago

Working for me too, I'm closing this as completed. :)