ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

NotificationList: clicking "close" button fires bubbling "close" event

Open Lukas742 opened this issue 6 months ago • 2 comments

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

  1. Go to StackBlitz
  2. Press the "Close" button
  3. See log in console coming from the close handler of the Dialog

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.

Lukas742 avatar Jun 18 '25 15:06 Lukas742

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.

dimovpetar avatar Jun 19 '25 07:06 dimovpetar

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

pskelin avatar Jun 19 '25 07:06 pskelin

This issue has been closed. To reopen, just leave a comment!

github-actions[bot] avatar Jul 30 '25 06:07 github-actions[bot]