Skip to content
Snippets Groups Projects
Commit 590122db authored by druid's avatar druid
Browse files

hide is-active-trail underlining when panel is shown

parent 7e1d4c64
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,9 @@
right: 0;
width: 100%;
}
&--is-active-trail--disabled::after {
border: none;
}
}
hy-icon {
......
......@@ -91,6 +91,14 @@ export class HyDesktopMenuLinks {
}
activeMenuItemSibling.setAttribute('aria-hidden', 'false');
//Hide is-active-trail underlining
const activeTrailMenuItem = this.el.shadowRoot.querySelector(
`.desktop-menu-link__label--is-active-trail`
) as HTMLElement;
if (activeTrailMenuItem) {
activeTrailMenuItem.classList.add('desktop-menu-link__label--is-active-trail--disabled');
}
// Add panels top value automatically with the correct header height
const headerHeight = `${
this.el.parentElement.offsetTop + this.el.parentElement.offsetHeight + this._headerBorderOffset
......@@ -141,6 +149,14 @@ export class HyDesktopMenuLinks {
// Return focus to the button of the last desktop panel that was active.
if (activeMenuItem !== null) activeMenuItem.focus();
//Show is-active-trail underlining
const activeTrailMenuItem = this.el.shadowRoot.querySelector(
`.desktop-menu-link__label--is-active-trail`
) as HTMLElement;
if (activeTrailMenuItem) {
activeTrailMenuItem.classList.remove('desktop-menu-link__label--is-active-trail--disabled');
}
// Reset elements by removing the active classes.
menuItems.forEach((item) => {
item.classList.remove('desktop-menu-link--is-active');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment