-
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(overflow-menu): check if function exists before calling #6707
fix(overflow-menu): check if function exists before calling #6707
Conversation
I see similar target.matches in
Maybe should have this check for all the cases. IDK what init-component is for, but I assume the others are similar to what overflow was doing. |
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.
IDK of a reason matches would be set to anything but function. But normally for libraries I go for overly cautious :/
172a4fe
to
cf46d8b
Compare
I agree, made it match Thanks again for catching that and taking a look 👍 |
Deploy preview for carbon-elements ready! Built with commit 172a4fe |
Thanks! I am a bit concerned with an event getting triggered in Firefox and then bubbling it in on viewport focus (with no target); that def seems like wrong behavior. I hope its a bug in Firefox and they fix it. But if not I fear it could show as more issue later for other events that rely on target (even if not error can cause the expected behaviors to get impacted). One concern I saw was it seemed when clicking in Firefox dev tools around the events backed up and would then hit the app over and over once viewport got focus (causing freezing). Seems very odd... Will keep an eye on Firefox's bug reports and open if I don't see others talking about it. |
Deploy preview for carbon-components-react ready! Built with commit 172a4fe https://deploy-preview-6707--carbon-components-react.netlify.app |
Deploy preview for carbon-elements ready! Built with commit cf46d8b |
Deploy preview for carbon-components-react ready! Built with commit cf46d8b https://deploy-preview-6707--carbon-components-react.netlify.app |
Closes #6705
Check if
target.matches
exists before invoking itChangelog
Changed
target.matches
exists before invoking itTesting / Reviewing
Using Firefox, open OverflowMenu, and open the menu. Then click anywhere outside the browser, return to the browser, and click anywhere inside to close the menu. There should not be an error.