Skip to content

Commit

Permalink
fix(sidebar-nav): set initial collapsible state
Browse files Browse the repository at this point in the history
  • Loading branch information
nowseemee committed Feb 2, 2022
1 parent c241a89 commit 78b7b7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SidebarNav should handle click 1`] = `
<scale-sidebar-nav collapsible="">
<scale-sidebar-nav>
<mock:shadow-root>
<div class="sidebar-nav sidebar-nav--collapsible" part="sidebar-nav collapsible">
<button aria-expanded="false" class="sidebar-nav__toggle-button" part="toggle-button">
Menu
<scale-icon-navigation-collapse-down class="sidebar-nav__icon" part="icon" size="16"></scale-icon-navigation-collapse-down>
</button>
<nav hidden="" part="nav">
<div class="sidebar-nav" part="sidebar-nav">
<nav part="nav">
<ul class="sidebar-nav__list" part="list" role="list">
<slot></slot>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class SidebarNav {
// Recent versions of Safari throw with `addEventListener`
// https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener
this.mq.addListener(this.handleMediaQueryChange);
this.collapsible = this.mq.matches;
}
}

Expand Down

0 comments on commit 78b7b7b

Please sign in to comment.