Skip to content

Commit

Permalink
- Get Active SubItem using the a strong selector pointing to the spec…
Browse files Browse the repository at this point in the history
…ific to sub itens instead of children list;
  • Loading branch information
JoaoFerreira-FrontEnd committed Jan 8, 2025
1 parent 7fa2a5f commit 02e4cbe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/scripts/OutSystems/OSUI/Utils/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,13 @@ namespace OutSystems.OSUI.Utils.Menu {
OSFramework.OSUI.Helper.Dom.ClassSelector(activeSubMenu, 'submenu-items') ||
OSFramework.OSUI.Helper.Dom.ClassSelector(activeSubMenu, 'osui-submenu__items');

const activeSubMenuItem = subMenuItem.children[ActiveSubItem] as HTMLElement;
const activeSubMenuItem = subMenuItem.querySelectorAll(
'[' +
OSFramework.OSUI.Constants.A11YAttributes.Role.AttrName +
"='" +
OSFramework.OSUI.Constants.A11YAttributes.Role.MenuItem +
"']"
)[ActiveSubItem] as HTMLElement;
if (activeSubMenuItem) {
OSFramework.OSUI.Helper.Dom.Styles.AddClass(activeSubMenuItem, 'active');
}
Expand Down

0 comments on commit 02e4cbe

Please sign in to comment.