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

Better support for useDocumentEventListeners on Menu components #545

Merged
merged 1 commit into from
Feb 20, 2022

Conversation

laviomri
Copy link
Contributor

Task
I've added better handling for useDocumentEventListeners. On other Menu-related components, most of the handlers are being disabled when useDocumentEventListeners = true. I've matched the critical paths' behavior, to avoid stealing the focus when not intended.
NOTE: MenuGridItem will not work properly when useDocumentEventListeners = true, since most of the handlers will now be turned off. I assume here that there's no such use case yet, since MenuGridItem is very new, and useDocumentEventListeners is rarely used.

@laviomri laviomri added the bug Something isn't working label Feb 17, 2022
@@ -130,10 +130,11 @@ const MenuItem = forwardRef(
}, [shouldShowSubMenu, childElement, useDocumentEventListeners]);

useEffect(() => {
if (useDocumentEventListeners) return;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most important part

@laviomri laviomri added PR: Bugfix 🐛 and removed bug Something isn't working labels Feb 17, 2022
@laviomri laviomri marked this pull request as draft February 17, 2022 16:58
@laviomri laviomri marked this pull request as ready for review February 20, 2022 09:27
@laviomri laviomri merged commit a445926 into master Feb 20, 2022
@laviomri laviomri deleted the fix/omri/fix-support-for-useDocumentEventListeners branch February 20, 2022 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants