shell: First selection is focused, even when there's an embedded widget #20526
Labels
bug
followup
Set when merging a PR on the condition that future work is done. Clear when work is complete.
page:shell
In the shell's session menu, the menu item is focused instead of the first widget, causing a hover-like selection.
It's point # 1 from #20340, which wasn't fixed. (Point # 2 was addressed with a workaround to not crop items inside the menu items, and we closed the issue based on that, even though it was just half-solved at the time.)
It turns out that PatternFly changed things to pre-focus the first item regardless, and as PatternFly-React nests widgets in menus inside the text part of the menu item element. (This was done as an intended accessibility fix, but had some side effects for anyone using non-text content inside of menus in PatternFly-React.)
Details @:
We're not the only ones having an issue based on this change.
@thatblindgeye also mentioned in a direct message in Slack that we could file an issue (if one doesn't exist) about adding initial focus being an option. He then suggests considering taking inspiration from the custom inline search menu example and "replacing the search input with your toggle group, then running a
setTimeout
inside the MenuToggle'sonClick
handler to focus whatever element when the menu is open, to pseudo-override the first menu item being focused".The text was updated successfully, but these errors were encountered: