Skip to content

[ui5-dialog]: Dialog does not close on browser navigation #13743

Description

@katieliu-sap

Bug Description

In SAP Analytics Cloud, we have many dialogs impemented with ui5-dialog. The issue is that on browser navigation, the dialog remains open over the new view, unlike their OpenUI5 counterparts (sap.m.Dialog) which close on hashchange.

Given that the ui5-dialog already recognizes the Esc-key as a dismissal signal and closes itself in response, there is more reason to expect that the dialog component should support closing on navigation as well as it indicates that the user is trying to leave the current view.

To work around this issue, every component implemented with ui5-dialog has to register a hashchange-listener for every open dialog and deregister it across every dismissal path which is not ideal.

Affected Component

ui5-dialog

Expected Behaviour

No response

Isolated Example

https://stackblitz.com/edit/js-abfqfaap?file=index.html

Steps to Reproduce

  1. Open the link above.
  2. Click "Open dialog" button
  3. Click "Navigate from inside the dialog" or click "Back" in the iframe (browser if you have the isolated example open).

Log Output, Stack Trace or Screenshots

No response

Priority

Medium

UI5 Web Components Version

1.24.28

Browser

Chrome

Operating System

Windows 11

Additional Context

One possible suggestion could be to add an optional boolean property to ui5-dialog like "close-on-navigation" for example. When "close-on-navigation" is true, the dialog starts the close lifecycle on browser navigation events.

<ui5-dialog close-on-navigation>...</ui5-dialog>

Organization

SAP Analytics Cloud

Declaration

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

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
New Issues

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions