-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(react): uishell headermenu blur handler #14616
Conversation
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 ✅
Hey @tw15egan, just noticed @andreancardona is on vacation this week. Is there some way I can request a review from someone else? I'm kind of eager to incorporate this change into my project, and I don't want to miss a version update. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just took a quick look thank you for the contribution @cordesmj !
Thank you so much, Andrea! Didn't mean to disturb your vacation 🤦 |
7d95369
Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com>
Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com>
* refactor(ComboBox): improve TS types * chore(ComboBox): fix file formatting * fix(react): uishell headermenu blur handler (#14616) Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com> * fix: add isSelected prop to IconButton (#14600) * fix: add isSelected prop to IconButton * fix: update snapshot * fix: change the HeaderMenuItem so it show docs in storybook (#14617) Co-authored-by: TJ Egan <tw15egan@gmail.com> * fix(contributors): remove duplicate contributors * test(snapshot): update snapshots --------- Co-authored-by: cordesmj <cordesmj@users.noreply.github.com> Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com> Co-authored-by: Aziz Chebbi <60013060+azizChebbi@users.noreply.github.com> Co-authored-by: TJ Egan <tw15egan@gmail.com>
Closes #14614
This PR modifies the HeaderMenu React component (part of the UIShell) such that when the menu loses focus, the menu is closed.
Changelog
Changed
HeaderMenu
changed so that when the menu loses focus the menu is closed, unless focus is going to a child menu.Testing / Reviewing
A basic test can be done on the storybook, as described in the referenced issue. That is, with this change, when tabbing through the submenu under "Link 4" in the storybook, upon pressing the Tab key from "Sub-link 3", focus passes to a link in the page content and the menu should close.
A more significant test can be done by adding a sub-submenu to the submenu. For example, in
packages/react/src/components/UIShell/UIShell.HeaderBase.stories.js
, after line 200, one could add the following:Tabbing around the menus should result in menus closing when losing focus, except when tabbing or clicking into child menus.
This will also facilitate extending the
HeaderMenu
to support a second level 'flyout' with the desired blur behavior.