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

[SF][A11y][ui5-dialog][ui5-popover] All dialogs and popovers close on press of esc key

Open bonnieso opened this issue 1 year ago • 2 comments

Bug Description

Opening this new ticket since the this issue still persists.

Reference: https://github.com/SAP/ui5-webcomponents/issues/6884

Bug Description

When multiple dialogs or popovers are open on a given page, pressing the "escape" key closes all of the dialogs and popovers. This happens when different cores of ui5-webcomponents exist on a page and different cores control different dialogs and popovers. So when then "escape" key is pressed, this line https://github.com/SAP/ui5-webcomponents/blob/63986f557a78ac14674d2e618ed40967ed5a1102/packages/main/src/popup-utils/OpenedPopupsRegistry.ts#L48 executes for all of the open dialogs and popovers because the open components are being tracked by this variable https://github.com/SAP/ui5-webcomponents/blob/63986f557a78ac14674d2e618ed40967ed5a1102/packages/main/src/popup-utils/OpenedPopupsRegistry.ts#L9 and the dialogs loaded from different cores aren't aware of each other. In order to solve this issue, we are proposing to add a registry that is shared across different cores.

Affected Component

ui5-dialog

Expected Behaviour

On press of the "escape" key, only the component (ui5-dialog or ui5-popover) that is in focus closes.

Isolated Example

Go to https://codesandbox.io/p/sandbox/ui5-webcomponents-forked-c867m7

Steps to Reproduce

  1. Go to https://codesandbox.io/p/sandbox/ui5-webcomponents-forked-c867m7
  2. Click "Open Dialog"
  3. Click "Open Inner Dialog"
  4. Press "Esc" key
  5. Observe that both dialogs close when only the inner one should close.

Log Output, Stack Trace or Screenshots

No response

Priority

Medium

UI5 Web Components Version

1.23.0

Browser

Chrome, Edge, Firefox, Safari

Operating System

No response

Additional Context

No response

Organization

SAP SuccessFactors

Declaration

  • [X] I’m not disclosing any internal or sensitive information.

bonnieso avatar Apr 05 '24 01:04 bonnieso

Hello @SAP/ui5-webcomponents-topic-rd,

this is regarding an issue involving multiple popups on a page with several ui5-webcomponents versions, following up on https://github.com/SAP/ui5-webcomponents/issues/6884. It appears there still might be some problems. Specifically, when closing the first dialog with the ESC key, the second one also closes unexpectedly.

Could you please investigate this?

Kind Regards, Dobrin

dobrinyonkov avatar Apr 05 '24 07:04 dobrinyonkov

Hello @bonnieso ,

Please elaborate on which version is the second runtime? The fix needs to be part of all runtimes, in order to work. In fact, there seems to be only 1 runtime in the given sample, but maybe this is just a sample issue? Please update and retest.

Best regards, Petar

dimovpetar avatar May 10 '24 12:05 dimovpetar

Hello, everyone! The issue has been inactive for 21 days. If there are still questions or comments, please feel free to continue the discussion. Inactive issues will be closed after 7 days!

github-actions[bot] avatar Jun 01 '24 00:06 github-actions[bot]

Hello, everyone! The issue has been inactive for 28 days, so I am closing the issue.

github-actions[bot] avatar Jun 09 '24 00:06 github-actions[bot]