-
Notifications
You must be signed in to change notification settings - Fork 16
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
IBX-8188: Fix breadcrumbs hidden menu (not opening) #1250
Conversation
tischsoic
commented
Apr 22, 2024
🎫 Issue | IBX-8188 |
---|
@@ -41,6 +42,10 @@ const Breadcrumbs = () => { | |||
const toggleHiddenListVisible = useCallback(() => { | |||
setHiddenListVisible(!hiddenListVisible); | |||
}, [setHiddenListVisible, hiddenListVisible]); | |||
const handleTogglerClick = (event) => { | |||
event.stopPropagation(); |
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.
Note: we need to stop this propagation because otherwise it may be caught again in hideHiddenMenuOnClickOutside
. Also, note that this event is a react event, which may have a different propagation than a standard DOM event.
const hideHiddenMenuOnClickOutside = (event) => { | ||
const { target } = event; | ||
|
||
if (hiddenListWrapperRef.current?.contains(target) ?? false) { |
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.
in theory ?? false
is unnecessary, I think? as if it does not exist, it's undefined, which is falsy as well
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.
I wanted to be explicit here so that it will be easier to understand when reading.
c524805
to
fcde668
Compare
Quality Gate passedIssues Measures |
Merged up:
|