Skip to content

Commit

Permalink
fix(ld-sidenav): in rare cases there is no parent nav-item
Browse files Browse the repository at this point in the history
  • Loading branch information
borisdiakur committed Nov 8, 2023
1 parent 5e85085 commit 06fdc64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/liquid/components/ld-sidenav/ld-sidenav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class LdSidenav {
// Set focus on parent nav-item element as soon as back button looses focus.
this.toFocus = parentSubnav
?.querySelector<HTMLLdSidenavNavitemElement>(`[to='${currentSubnavId}']`)
.shadowRoot.querySelector<HTMLButtonElement | HTMLAnchorElement>(
?.shadowRoot.querySelector<HTMLButtonElement | HTMLAnchorElement>(
'[part*="focusable"]'
)

Expand Down

0 comments on commit 06fdc64

Please sign in to comment.