Skip to content

Conversation

@TeodorTaushanov
Copy link
Member

@TeodorTaushanov TeodorTaushanov commented Sep 9, 2025

Fixes issues with closing popups when the escape key is pressed in a mixed environment of OpenUI5 and UI5 Web Components. The fix ensures proper event handling and prevents interference between OpenUI5 and Web Component popup escape key behavior.

JIRA: BGSOFUIRODOPI-3523

@cla-assistant
Copy link

cla-assistant bot commented Sep 9, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue with closing popups when the escape key is pressed in a mixed environment of OpenUI5 and UI5 Web Components. The fix ensures proper event handling and prevents interference between OpenUI5 and Web Component popup escape key behavior.

Key changes:

  • Added event marking utilities to prevent conflicts between popup systems
  • Modified popup registry to check for marked events before handling escape
  • Updated ComboBox escape key handling to be more selective about propagation

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/main/test/pages/DialogAndOpenUI5Dialog.html Added comprehensive test scenarios with mixed OpenUI5 and Web Component popups
packages/main/src/popup-utils/OpenedPopupsRegistry.ts Added event marking check to prevent handling already-processed escape events
packages/main/src/ComboBox.ts Refined escape key handling to only stop propagation when value is reset
packages/main/cypress/specs/OpenUI5andWebCPopups.cy.tsx Added Cypress tests for mixed popup scenarios and escape key behavior
packages/base/src/util/openui5support/eventMarking.ts New utility for marking events to prevent duplicate handling
packages/base/src/features/patchPopup.ts Added popup control patching to prevent escape handling when Web Components are above
packages/base/src/features/OpenUI5Support.ts Updated to include Dialog and Popover controls in the patching process
Comments suppressed due to low confidence (1)

packages/base/src/features/patchPopup.ts:1

  • There's a mismatch between the parameter type and the property being patched. Line 96 should patch PopupControl.prototype.onsapescape not Popup.prototype.onsapescape.
// OpenUI5's Control.js subset

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview September 30, 2025 07:17 Inactive
@TeodorTaushanov TeodorTaushanov requested review from a team and Stoev September 30, 2025 07:29
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview September 30, 2025 07:35 Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 1, 2025 11:26 Inactive
Copy link
Member

@alexandar-mitsev alexandar-mitsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Open WebC Dialog -> Open UI5 With shortcut -> Open WebC Dialog. Then press ESC several times - not all dialogs are closed. Same happens with OpenUI5 dialog and WebC responsive popover. ESC does not close the openui5 dialog
  • Open OpenUI5 Dilaog -> the webcomponents combobox does not work - the suggestions never appear, neither if you click the arrow, nor if you start writing. There is a related console error

The following are bugs reported in the Same BLI, but can be solved in different change:

  • Open OpenUI5 Dilaog -> press "Tab" you can never reach the webcomponents content. Also initial focus skips all webcomponents and focuses the first openui5 control
  • Open WebC Dialog with keyboard the select is directly opened when the dialog is opened
  • OpenUI5 Dialog -> Open WebC PR with no intial focus -> keyboard focus can never reach the opened popover

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 2, 2025 13:07 Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 2, 2025 13:31 Inactive
@TeodorTaushanov
Copy link
Member Author

  • Open WebC Dialog -> Open UI5 With shortcut -> Open WebC Dialog. Then press ESC several times - not all dialogs are closed. Same happens with OpenUI5 dialog and WebC responsive popover. ESC does not close the openui5 dialog

-- This is an OpenUI5 Dialog issue. I reported it - SNOW: DINC0654974

  • Open OpenUI5 Dilaog -> the webcomponents combobox does not work - the suggestions never appear, neither if you click the arrow, nor if you start writing. There is a related console error

-- Fixed in the test page

The following are bugs reported in the Same BLI, but can be solved in different change:

  • Open OpenUI5 Dilaog -> press "Tab" you can never reach the webcomponents content. Also initial focus skips all webcomponents and focuses the first openui5 control

-- In OpenUI5 project Focusable util doesn't find focusable Web Components. We should decide how and where the fix should be.

  • Open WebC Dialog with keyboard the select is directly opened when the dialog is opened

-- sap.m.Select issue

  • OpenUI5 Dialog -> Open WebC PR with no intial focus -> keyboard focus can never reach the opened popover

-- this is by design. "no initial focus" functionality is used in ComboBox and the focus never goes to the popover

Copy link
Member

@alexandar-mitsev alexandar-mitsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Team Rila should review the changes in ComboBox

@alexandar-mitsev alexandar-mitsev dismissed their stale review October 3, 2025 13:01

LGTM
Team Rila should review the changes in ComboBox

@TeodorTaushanov TeodorTaushanov requested a review from MapTo0 October 3, 2025 13:18
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 3, 2025 13:35 Inactive
@TeodorTaushanov TeodorTaushanov merged commit f54e8af into main Oct 6, 2025
21 of 22 checks passed
@TeodorTaushanov TeodorTaushanov deleted the popup_patcher_keyboard branch October 6, 2025 11:45
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 6, 2025 11:46 Inactive
@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This PR is included in version v2.16.0-rc.0 🎉

The release is available on v2.16.0-rc.0

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants