fix(Select/Dropdown): updated autofocus to false by default in v6
What: Towards #10393
We have a followup to investigate improving the focus logic/styling overall post-v6
Additional issues:
Preview: https://patternfly-react-pr-11115.surge.sh
A11y report: https://patternfly-react-pr-11115-a11y.surge.sh
As as addon to Adam's comment, we could also remove Tab from being a default toggle key temporarily. That way a user could tab into the menu while its open to get to the keyboard handling.
@adamviktora I think I did something similar locally at some point when tinkering around, though it was done as part of the base Menu/Select/Dropdown logic (rather than in each example code). May depend whether we would want to at least show a way consumers could handle focus management themselves in the mean time (since if a consumer opts to not autofocus for a non-typeahead, they'll have to do handle it themselves), or if we want to wait and see what potentially refactoring the logic internally may look like.
@kmcfaul one issue with that may be that it depends where the menu is appended; with the document body appending then Tab may not go into the menu itself
@thatblindgeye I prefer doing it as part of the base Menu logic. Consumers will probably expect it to be an out-of-the-box behaviour, so it will be better if it is part of the base component.
if we want to wait and see what potentially refactoring the logic internally may look like
I prefer this, but it depends how long will it be, so we don't ship a half-working version now. But if the followup to fix it is a high priority, then I am absolutely ok with it.
The current plan is:
- Merge this PR as-is
- Create a followup for v6 to add logic internal to Select, Dropdown, and MenuContainer to handle up/down arrow keys focusing items with ability to customize this
- Re-evaluate whether https://github.com/patternfly/patternfly-react/issues/11025 is still applicable
Your changes have been released in:
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
- [email protected]
- @patternfly/[email protected]
- @patternfly/[email protected]
Thanks for your contribution! :tada: