-
Notifications
You must be signed in to change notification settings - Fork 208
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: keep parent overlays open when not closing child hover overlays #2726
Conversation
Tachometer resultsChromeaction-bar permalink
action-menu permalink
menu permalink
overlay permalink
picker permalink
popover permalink
split-button permalink
tooltip permalink
Firefoxaction-bar permalink
action-menu permalink
menu permalink
overlay permalink
picker permalink
popover permalink
split-button permalink
tooltip permalink
|
a17cd78
to
eabad5e
Compare
@@ -611,9 +611,11 @@ export class OverlayStack { | |||
while (index && overlaysToClose.length === 0) { | |||
index -= 1; | |||
const overlay = this.overlays[index]; | |||
const path = event.composedPath(); |
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 may not understand what's being checked here enough to label it properly, but consider something like this?
const path = event.composedPath(); | |
const path = event.composedPath(); | |
const isOutsideTriggerAndContent = (!path.includes(overlay.trigger) || overlay.interaction !== 'hover') && !path.includes(overlay.overlayContent; |
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.
Good call. The naming here is hard, but I've paired it with an update comment from the change that broke this, so hopefully it's more understandable in the future.
(!path.includes(overlay.trigger) || | ||
overlay.interaction !== 'hover') && | ||
!path.includes(overlay.overlayContent) |
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.
(!path.includes(overlay.trigger) || | |
overlay.interaction !== 'hover') && | |
!path.includes(overlay.overlayContent) | |
isOutsideTriggerAndContent |
eabad5e
to
8919e5b
Compare
Description
Prevent clicks within ancestor overlays from closing those ancestor overlays.
Related issue(s)
How has this been tested?
Types of changes
Checklist