Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui5-menu): fix focus steal of ui5-wizard in mozilla #9845

Merged
merged 15 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/main/src/Menu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@
</ui5-busy-indicator>
{{/if}}
</div>
</ui5-responsive-popover>

<div
class="ui5-menu-submenus"
>
</div>
{{#if menuHasSubMenus}}
<div
class="ui5-menu-submenus"
>
</div>
{{/if}}
</ui5-responsive-popover>
8 changes: 7 additions & 1 deletion packages/main/src/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ class Menu extends UI5Element {
Menu.i18nBundle = await getI18nBundle("@ui5/webcomponents");
}

get menuHasSubMenus() {
return !!this.items.filter(item => item.hasSubmenu).length;
}

get itemsWithChildren() {
return !!this._currentItems.filter(item => item.item.items.length).length;
}
Expand Down Expand Up @@ -564,7 +568,9 @@ class Menu extends UI5Element {
if (menuItem && menuItem.hasSubmenu) {
// create new sub-menu
this._createSubMenu(menuItem, opener);
this._openItemSubMenu(menuItem, opener);
setTimeout(() => {
hinzzx marked this conversation as resolved.
Show resolved Hide resolved
this._openItemSubMenu(menuItem, opener);
}, 0);
}
if (parentMenuItem) {
parentMenuItem._preventSubMenuClose = true;
Expand Down
Loading