-
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(menu): include leave intent delay for sub menus #16466
fix(menu): include leave intent delay for sub menus #16466
Conversation
The sub menu can accidentally trigger a premature closure of the sub menu in the following cases: - the mouse moves across and down as the user selects a lower sub menu, causing the mouse to leave the menuItem. - the menu has a scroll bar, as the mouse crosses this to enter the sub menu it triggers the closure before the user can access the sub menu. Including a delay in the closure allows for the users mouse to reenter the submenu and cancel the closure of the menu.
All contributors have signed the DCO. |
✅ 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. |
I have read the DCO document and I hereby sign the DCO. |
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.
Excellent, thanks for contributing this! 🙏
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!
@Kilian-Collender I can reproduce the avt error in storybook |
Head branch was pushed to by a user without write access
1771cb6
Closes #16395
Menu component does not protect access to refs in focusItem by adding protection to the accessing of the refs.
Changelog
New
Adds leave intent delay for sub menu as it can accidentally trigger a premature closure of the sub menu in the following cases:
Including a delay in the closure allows for the users mouse to reenter the submenu and cancel the closure of the menu.
Changed
Testing / Reviewing
Unit tests have been added to validate the opening and closing of the sub menu using fake timers.
Manual testing can be easily done by opening the submenu and quickly moving the mouse out and back into the menu item and the menu will close.