Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shell: First selection is focused, even when there's an embedded widget #20526

Open
garrett opened this issue May 28, 2024 · 0 comments
Open
Labels
bug followup Set when merging a PR on the condition that future work is done. Clear when work is complete. page:shell

Comments

@garrett
Copy link
Member

garrett commented May 28, 2024

In the shell's session menu, the menu item is focused instead of the first widget, causing a hover-like selection.

image

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's onClick handler to focus whatever element when the menu is open, to pseudo-override the first menu item being focused".

@garrett garrett added bug page:shell followup Set when merging a PR on the condition that future work is done. Clear when work is complete. labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug followup Set when merging a PR on the condition that future work is done. Clear when work is complete. page:shell
Projects
None yet
Development

No branches or pull requests

1 participant