This repository was archived by the owner on Jan 14, 2025. It is now read-only.
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
List Item Steals Focus After Selection #763
Closed
Description
While running through potential use cases for a filtered list component I am working on, I found a strange bug. Rather than explain it, I figured showing it would be better:
https://codesandbox.io/s/32788k0p5q
Follow these steps:
- Enter "little" into the text field.
- Press tab, then use the down arrow to highlight "Three Little Code Bugs"
- Press enter - everything should clear (this is intentional)
- Try to enter "little code" into the text field.
You should find once you get "little c" entered "Nine Little Code Bugs" becomes focused, which is in the slot "Three Little Code Bugs" was when it was originally selected. This behaviour persists until the page is refreshed.
I have not dug into why this is happening yet, but once I get a little more time today or tomorrow I will dive into the code and see what I can find. I figured I would submit this in case someone already has an idea of what might be happening or gets to it before I do.