Skip to content

Commit

Permalink
fix(ld-sidenav): collapse fully if it has no primary mode nav items
Browse files Browse the repository at this point in the history
  • Loading branch information
borisdiakur committed Feb 14, 2023
1 parent fccc96e commit f6c5e85
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 57 deletions.
9 changes: 6 additions & 3 deletions src/liquid/components/ld-sidenav/ld-sidenav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,12 @@ export class LdSidenav {
private activeSubnavContainsIconsOrHasBack = () => {
// Return true if we have a back button or a nav items as a direct child.
if (
Array.from(this.el.children).filter((child) =>
['LD-SIDENAV-BACK', 'LD-SIDENAV-NAVITEM'].includes(child.tagName)
)
Array.from(this.el.children).filter(
(child) =>
child.tagName === 'LD-SIDENAV-BACK' ||
(child.tagName === 'LD-SIDENAV-NAVITEM' &&
!(child as HTMLLdSidenavNavitemElement).mode)
).length
) {
return true
}
Expand Down
Loading

0 comments on commit f6c5e85

Please sign in to comment.