Skip to content

Commit

Permalink
Merge pull request #16236 from primefaces/issue-16233
Browse files Browse the repository at this point in the history
Fixed #16233 - Sidebar: Overlay of Nested Sidebar Blocks Its Own Content
  • Loading branch information
cetincakiroglu authored Aug 15, 2024
2 parents c13745a + 428aad0 commit d2756f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/components/sidebar/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,13 @@ export class Sidebar implements AfterViewInit, AfterContentInit, OnDestroy {
}

enableModality() {
const activeDrawers = this.document.querySelectorAll('.p-sidebar-active');
const activeDrawersLength = activeDrawers.length;
const zIndex = activeDrawersLength == 1 ? String(parseInt((this.container as HTMLDivElement).style.zIndex) - 1) : String(parseInt((activeDrawers[0] as HTMLElement).style.zIndex) - 1);

if (!this.mask) {
this.mask = this.renderer.createElement('div');
this.renderer.setStyle(this.mask, 'zIndex', String(parseInt((this.container as HTMLDivElement).style.zIndex) - 1));
this.renderer.setStyle(this.mask, 'zIndex', zIndex);
DomHandler.addMultipleClasses(this.mask, 'p-component-overlay p-sidebar-mask p-component-overlay p-component-overlay-enter');

if (this.dismissible) {
Expand Down

0 comments on commit d2756f9

Please sign in to comment.