From ce97c0fa2619436f691e62146eece2713de795e4 Mon Sep 17 00:00:00 2001 From: Egor Volvachev Date: Sat, 25 Jun 2022 17:27:36 +0300 Subject: [PATCH] fix(primeng/calendar): fix error in mode `touchUI="true"` and `inline="true"` Fixes #11649. --- src/app/components/calendar/calendar.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index 155010b1e36..3ff7b6fc5ab 100755 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -2461,7 +2461,7 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor { } enableModality(element) { - if (!this.mask) { + if (!this.mask && !this.touchUI) { this.mask = document.createElement('div'); this.mask.style.zIndex = String(parseInt(element.style.zIndex) - 1); let maskStyleClass = 'p-component-overlay p-datepicker-mask p-datepicker-mask-scrollblocker p-component-overlay p-component-overlay-enter'; @@ -2484,6 +2484,10 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor { } destroyMask() { + if (!this.mask) { + return; + } + document.body.removeChild(this.mask); let bodyChildren = document.body.children; let hasBlockerMasks: boolean;