Fixed #519 - TouchUI modal gets stuck if input tabs out

pull/548/head
Cagatay Civici 2020-10-10 14:23:45 +03:00
parent 355399f47d
commit 782d3f8ef6
1 changed files with 28 additions and 27 deletions

View File

@ -343,8 +343,7 @@ export default {
} }
if (this.mask) { if (this.mask) {
this.disableModality(); this.destroyMask();
this.mask = null;
} }
this.restoreAppend(); this.restoreAppend();
@ -554,6 +553,11 @@ export default {
this.unbindScrollListener(); this.unbindScrollListener();
this.unbindResizeListener(); this.unbindResizeListener();
this.$emit('hide'); this.$emit('hide');
if (this.mask) {
this.disableModality();
}
this.overlay = null; this.overlay = null;
}, },
onPrevButtonClick(event) { onPrevButtonClick(event) {
@ -771,10 +775,6 @@ export default {
if (this.isSingleSelection() && (!this.showTime || this.hideOnDateTimeSelect)) { if (this.isSingleSelection() && (!this.showTime || this.hideOnDateTimeSelect)) {
setTimeout(() => { setTimeout(() => {
this.overlayVisible = false; this.overlayVisible = false;
if (this.mask) {
this.disableModality();
}
}, 150); }, 150);
} }
}, },
@ -1309,7 +1309,7 @@ export default {
DomHandler.addMultipleClasses(this.mask, 'p-datepicker-mask p-datepicker-mask-scrollblocker'); DomHandler.addMultipleClasses(this.mask, 'p-datepicker-mask p-datepicker-mask-scrollblocker');
this.maskClickListener = () => { this.maskClickListener = () => {
this.disableModality(); this.overlayVisible = false;
}; };
this.mask.addEventListener('click', this.maskClickListener); this.mask.addEventListener('click', this.maskClickListener);
@ -1323,10 +1323,13 @@ export default {
}, },
disableModality() { disableModality() {
if (this.mask) { if (this.mask) {
this.overlayVisible = false;
DomHandler.addClass(this.mask, 'p-datepicker-mask-leave'); DomHandler.addClass(this.mask, 'p-datepicker-mask-leave');
this.mask.addEventListener('transitionend', () => { this.mask.addEventListener('transitionend', () => {
this.destroyMask();
});
}
},
destroyMask() {
this.mask.removeEventListener('click', this.maskClickListener); this.mask.removeEventListener('click', this.maskClickListener);
this.maskClickListener = null; this.maskClickListener = null;
document.body.removeChild(this.mask); document.body.removeChild(this.mask);
@ -1345,8 +1348,6 @@ export default {
if (!hasBlockerMasks) { if (!hasBlockerMasks) {
DomHandler.removeClass(document.body, 'p-overflow-hidden'); DomHandler.removeClass(document.body, 'p-overflow-hidden');
} }
});
}
}, },
updateCurrentMetaData() { updateCurrentMetaData() {
const viewDate = this.viewDate; const viewDate = this.viewDate;