Closed AlexisDeschamps closed 3 years ago
@LeaVerou Thank you for the guidance. That makes sense. I modified the preventDefault
call to be under a specific clause and added a unit test. Please let me know if there is something else I should add or change.
Merged, thanks!
It seems the branch for handling a
tab
key event iftabSelect: true
is missing anevt.preventDefault()
, which results in an item being skipped when autocompletes are created in a list.To fix this, I believe we could call
evt.preventDefault()
in all branches of the procedure, instead of only some.I have manually tested that this fixes the problem on our UI. The existing tests also appear to pass. If this change seems to make sense, I can look into adding a test.
Example
Initial state![image](https://user-images.githubusercontent.com/12681350/121836647-bf2dcb00-cc88-11eb-8c6a-625e2657e453.png)
(Current behavior): final state after pressing tab:![image](https://user-images.githubusercontent.com/12681350/121836881-395e4f80-cc89-11eb-979d-18431b6ccbeb.png)
(Expected behavior): final state after pressing tab:![image](https://user-images.githubusercontent.com/12681350/121836792-074ced80-cc89-11eb-97e5-ed19c3fbd8f4.png)