Skip to content

Commit

Permalink
BUGFIX: Wait for check if hamburger button is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Jul 22, 2022
1 parent 0401791 commit 094661d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Resources/Private/Fusion/Presentation/Section/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ Alpine.data('header', (homeUri) => ({
},
onResize() {
this.mobileMenuOpen = false;
// Check if the mobile menu button is hidden
this.desktopView = !this.$refs.mobileMenuButton.offsetParent;

this.$nextTick(() => {
// Check if the mobile menu button is hidden
this.desktopView = !this.$refs.mobileMenuButton.offsetParent;
const height = this.$root.offsetHeight;
document.documentElement.style.setProperty('--header-height', `${height}px`);
this.enableCollapse = !this.desktopView;
Expand Down

0 comments on commit 094661d

Please sign in to comment.