-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Labels
bugSomething isn't workingSomething isn't workingregressionSometimes we make things breakSometimes we make things breakv25To be done in V25To be done in V25vaadin-notification
Description
Description
Since refactoring overlays to be in the shadow root of their owning components, events such as vaadin-dialog-close
do not propagate to the document anymore. As such this logic for preventing overlays from closing when interacting with notifications (clicking, pressing Escape) does not work anymore:
web-components/packages/notification/src/vaadin-notification-mixin.js
Lines 93 to 102 in 1f39766
/** @private */ | |
_onVaadinOverlayClose(event) { | |
// Notifications are a separate overlay mechanism from vaadin-overlay, and | |
// interacting with them should not close modal overlays | |
const sourceEvent = event.detail.sourceEvent; | |
const isFromNotification = sourceEvent && sourceEvent.composedPath().indexOf(this) >= 0; | |
if (isFromNotification) { | |
event.preventDefault(); | |
} | |
} |
Expected outcome
Interacting with a notification should not affect other overlays.
Apart from fixing the logic we should also add a proper integration test using a notification and dialog, as the existing test was not sufficient in detecting this regression.
Minimal reproducible example
<vaadin-dialog opened></vaadin-dialog>
<vaadin-notification opened></vaadin-notification>
Steps to reproduce
- Click the notification
- Observe that the dialog closes
Environment
Vaadin version(s): v25 only
Browsers
Issue is not browser related
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingregressionSometimes we make things breakSometimes we make things breakv25To be done in V25To be done in V25vaadin-notification