Skip to content

Conversation

@kskondov
Copy link
Contributor

@kskondov kskondov commented Nov 11, 2025

OpenUI5 dialogs' and the Web Components dialogs' block layers are rendered and displayed in the order of opened dialogs.
Fixes: #12444

OpenUI5 dialogs' and the WebC dialogs' block layers are rendered in order
Fixes: 12444
@ui5-webcomponents-bot
Copy link
Collaborator

ui5-webcomponents-bot commented Nov 11, 2025

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview November 11, 2025 09:35 Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview November 11, 2025 11:18 Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview November 11, 2025 14:16 Inactive
Copy link

@Stoev Stoev left a comment

Choose a reason for hiding this comment

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

OpenUI5 dialogs' and the Web Components dialogs' block layers are rendered and displayed in the order of opened dialogs.

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview November 19, 2025 13:26 Inactive
@kskondov kskondov requested a review from Stoev November 20, 2025 08:59
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview November 21, 2025 14:20 Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview November 24, 2025 12:28 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.

  • when you start from "Open WebC Dialog" and reach to the "Web Component Dialog 2". Press on "Open UI5 Popover" - the focus moves to the "Web Component Dialog 1". See attached image
Screen1

};

const openNativePopover = (domRef: HTMLElement) => {
const enableNativePopoverForOpenUI5 = (domRef: HTMLElement, popup: OpenUI5Popup) => {
Copy link
Member

Choose a reason for hiding this comment

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

enable and disable sounds strange. I was confused the first time I read it.
openNativePopover was better I think. Can be openNativePopoverForOpenUI5

same for disable and close, close sounds more clear

}

const prevPopupContent = prevPopup.instance.getContent()!;
const content = prevPopupContent instanceof HTMLElement ? prevPopupContent : prevPopupContent?.getDomRef();
Copy link
Member

Choose a reason for hiding this comment

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

now you have this 2 rows on 3 places. Make it a separate funciton. E.g. getPopupContentElement

};

type OpenUI5PopupBasedControl = {
// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed)
Copy link
Member

Choose a reason for hiding this comment

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

this comment should be before the OpenUI5Popup type? Line 9

document.getElementById("dialogButton").addEventListener("click", function () {
openUI5Dialog(win);
});

Copy link
Member

Choose a reason for hiding this comment

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

  • add a sample with an OpenUI5 popover which is modal and opened from a dialog

domRef.removeAttribute("popover");
}

const lastPopup = AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 1];
Copy link
Member

Choose a reason for hiding this comment

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

if you close a popup which is different then lastPopup, you should not hide the block layer. E.g. if dialog behind the top most one is closed.
Currently this works because the fixOpenUI5PopupBelow fixes it, but otherwise it shouldn't be the case


content?.hidePopover();

if (prevPopup.instance.getModal()) {
Copy link
Member

Choose a reason for hiding this comment

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

you already checked if it is modal on line 116

}

const prevPopup = AllOpenedPopupsRegistry.openedRegistry[AllOpenedPopupsRegistry.openedRegistry.length - 2];
if (!prevPopup || prevPopup.type !== "OpenUI5" || !prevPopup.instance.getModal()) {
Copy link
Member

Choose a reason for hiding this comment

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

you can split this on several lines or several ifs to make it more readable

_origClosed.apply(this, args); // only then call _close
if (domRef) {
closeNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM
disableNativePopoverForOpenUI5(domRef); // unset the popover attribute and close the native popover, but only if still in DOM
Copy link
Member

Choose a reason for hiding this comment

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

disableNativePopoverForOpenUI5(domRef, this);
add "this" to the params of the function
then you can use it inside the function to check for lastPopup

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ui5-dialog and OpenUI5 Dialog]: The sap.m.Dialog's block layer is not correct when integrated with UI5 Web Components

6 participants