Menu/Select/Dropdown - considering refactoring focus logic
Describe the enhancement or change
We should consider refactoring the focus logic in these 3 components. One suggestion that had been brought up was removing/moving focus when a Menu Item is hovered (similar to how a native select element does), but that depends if we want to go that route or keep the existing, intended behavior that more closely resembles this ARIA APG select example.
Could possibly also be partially resolved by Core/Design updates to include custom focus styling instead of relying on browser defaults (which has in part led to some confusion with these components)
Other possible suggestions:
- Add a prop to allow consumers to customize the selectors that can be focused in the
menuRef?.current?.querySelectorcall - Adding a prop to prevent autofocus on mouse click
- This would require us to add logic to handle moving into the Menu via Up/Down arrow keys; another way would be to update the onOpenChangeKeys array to only "Escape", so that Tab could be used to get into the Menu
- Refactor the logic so that either the first selected item is focused, otherwise the first item is selected
Is this request originating from a Red Hat product team? If so, which ones and is there any sort of deadline for this enhancement?
Any other information?