fix(menu): prevent submenu blur from closing parent menu#22186
Conversation
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22186 +/- ##
==========================================
+ Coverage 95.11% 95.49% +0.37%
==========================================
Files 549 582 +33
Lines 45644 50334 +4690
Branches 6528 6751 +223
==========================================
+ Hits 43413 48064 +4651
- Misses 2101 2138 +37
- Partials 130 132 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
devadula-nandan
left a comment
There was a problem hiding this comment.
LGTM
can we bump this coverage?
❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
|
@devadula-nandan Increased coverage 👍 . Not sure why it's complaining about line 141, though, it doesn't show up as not covered in the ci itself.
|
420d0c2

Closes #22143
Fixes an issue where hovering on a submenu, then blurring the submenu would close the entire menu, including the parent.
Changelog
Changed
onOpenChangeinMenuItem.tsxto return focus to its parent when it closes, similar to how its done in Web ComponentsTesting / Reviewing
Please feel free to pull down this branch and test a bunch of different menu configurations if there are any edge cases I'm missing. I tested this locally with nested submenus, as well as sibling submenus when directly stacked on top of each other and also when spread apart. (reason for 071702a, the page would crash otherwise)
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
[ ] Updated documentation and storybook examples