Skip to content

Commit

Permalink
fix: primefaces#14230 || BlockUI: entire page is blocked if "blocked"…
Browse files Browse the repository at this point in the history
… input contains true by default
  • Loading branch information
ashikjs committed Dec 11, 2023
1 parent cd401fa commit cf17076
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/components/blockui/blockui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ZIndexUtils } from 'primeng/utils';
[class]="styleClass"
[attr.aria-busy]="blocked"
[ngClass]="{ 'p-blockui-document': !target, 'p-blockui p-component-overlay p-component-overlay-enter': true }"
[ngStyle]="{ display: blocked ? 'flex' : 'none' }"
[ngStyle]="{ display: 'none' }"
[attr.data-pc-name]="'blockui'"
[attr.data-pc-section]="'root'"
>
Expand Down Expand Up @@ -80,6 +80,8 @@ export class BlockUI implements AfterViewInit, OnDestroy {
constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, public cd: ChangeDetectorRef, public config: PrimeNGConfig, private renderer: Renderer2, @Inject(PLATFORM_ID) public platformId: any) {}

ngAfterViewInit() {
if (this._blocked) this.block();

if (this.target && !this.target.getBlockableElement) {
throw 'Target of BlockUI must implement BlockableUI interface';
}
Expand All @@ -102,6 +104,7 @@ export class BlockUI implements AfterViewInit, OnDestroy {
block() {
if (isPlatformBrowser(this.platformId)) {
this._blocked = true;
(this.mask as ElementRef).nativeElement.style.display = 'flex'

if (this.target) {
this.target.getBlockableElement().appendChild((this.mask as ElementRef).nativeElement);
Expand Down

0 comments on commit cf17076

Please sign in to comment.