Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #14230 || BlockUI: entire page is blocked if "blocked" input con… #14234

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading