Skip to content

Commit

Permalink
Merge pull request #347 from conversionxl/raphael/fix/navigation/empt…
Browse files Browse the repository at this point in the history
…y-submenus
  • Loading branch information
pawelkmpt authored Oct 24, 2023
2 parents 7c3802e + b14a39c commit 41d01f1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/cxl-ui/src/components/cxl-marketing-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,13 @@ export class CXLMarketingNavElement extends LitElement {
const firstOverlay = overlays[0];

if (this.overlaysWrapperElement) {
this.overlaysWrapperElement.style.maxHeight = `${
window.innerHeight -
(this.overlaysWrapperElement.style?.maxHeight || firstOverlay.offsetTop)
}px`;
if (overlays.length > 1) {
const heightOffset =
this.overlaysWrapperElement.style?.maxHeight || firstOverlay.offsetTop;
this.overlaysWrapperElement.style.maxHeight = `${
window.innerHeight - (heightOffset || 0)
}px`;
}

this.overlaysWrapperElement.appendChild(overlay);
this.overlaysWrapperElement.toggleAttribute('hidden', false);
Expand Down

0 comments on commit 41d01f1

Please sign in to comment.