NotificationList: clicking "close" button fires bubbling "close" event
Bug Description
When pressing the "Close" button of an NotificationListItem a close event is fired, which bubbles up. In my opinion, this is unexpected as the expected event is item-close and can therefore lead to strange behavior when notifications are used inside a popover or dialog for example.
Affected Component
NotificationList, NotificationListItem
Expected Behaviour
No response
Isolated Example
https://stackblitz.com/edit/github-53zsov4m?file=src%2FApp.tsx
Steps to Reproduce
- Go to StackBlitz
- Press the "Close" button
- See log in console coming from the
closehandler of theDialog
Log Output, Stack Trace or Screenshots
No response
Priority
None
UI5 Web Components Version
2.11.0
Browser
Chrome
Operating System
No response
Additional Context
No response
Organization
No response
Declaration
- [x] I’m not disclosing any internal or sensitive information.
Currently, when writing handler for dialog's close event, one should always check the target,
@SAP/ui5-webcomponents-topic-rd , as far as I understood, notification list's close even should not bubble.
Yes, I can't find it documented in a single place, but we discussed and agreed that the best practice is for applications to attach a handler and not check the target, hence no bubbling of events is more app developer friendly. For close events this is always the case - they should not bubble.
That's also what most other components are doing already like described in this PR: https://github.com/SAP/ui5-webcomponents/pull/10030
This issue has been closed. To reopen, just leave a comment!