Skip to content

Commit 30e96a3

Browse files
committed
small tweak to max height logic for mobile menu
1 parent 7df081a commit 30e96a3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/js/05-mobile-navbar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ document.addEventListener('DOMContentLoaded', function () {
88
el.classList.toggle('is-active')
99
var menu = document.getElementById(el.dataset.target)
1010
if (menu.classList.toggle('is-active')) {
11+
menu.style.maxHeight = ''
1112
var expectedMaxHeight = window.innerHeight - Math.round(menu.getBoundingClientRect().top)
1213
var actualMaxHeight = parseInt(window.getComputedStyle(menu).maxHeight)
1314
if (actualMaxHeight !== expectedMaxHeight) menu.style.maxHeight = expectedMaxHeight + 'px'

0 commit comments

Comments
 (0)