Skip to content

Commit eb68eef

Browse files
committed
fix(sidebar) mobile sidebar not dismissed on link click
1 parent ee0339b commit eb68eef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

js/src/sidebar.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const Sidebar = (($) => {
4646
BRAND_MINIMIZER : '.brand-minimizer',
4747
NAV_DROPDOWN_TOGGLE : '.nav-dropdown-toggle',
4848
NAV_DROPDOWN_ITEMS : '.nav-dropdown-items',
49+
NAV_ITEM : '.nav-item',
4950
NAV_LINK : '.nav-link',
5051
NAVIGATION_CONTAINER : '.sidebar-nav',
5152
NAVIGATION : '.sidebar-nav > .nav',
@@ -165,6 +166,10 @@ const Sidebar = (($) => {
165166
const toggle = event.currentTarget.dataset.toggle
166167
toggleClasses(toggle, ShowClassNames)
167168
})
169+
170+
$(`${Selector.NAVIGATION} > ${Selector.NAV_ITEM} ${Selector.NAV_LINK}:not(${Selector.NAV_DROPDOWN_TOGGLE})`).on(Event.CLICK, () => {
171+
document.body.classList.remove('sidebar-show')
172+
})
168173
}
169174

170175
// Static

0 commit comments

Comments
 (0)