Skip to content

Commit

Permalink
Fixed #16233 - Sidebar: Overlay of Nested Sidebar Blocks Its Own Content
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Aug 15, 2024
1 parent 2929519 commit 428aad0
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 428aad0

Please sign in to comment.