Fixed #869 - Sidebar Mask not being removed from DOM

pull/880/head
Cagatay Civici 2021-01-20 11:43:46 +03:00
parent bb49c9fcf1
commit e6a02b264c
1 changed files with 10 additions and 5 deletions

View File

@ -54,7 +54,7 @@ export default {
mask: null,
maskClickListener: null,
beforeUnmount() {
this.unbindMaskClickListener();
this.destroyModal();
},
methods: {
hide() {
@ -104,10 +104,7 @@ export default {
if (this.mask) {
DomHandler.addClass(this.mask, 'p-sidebar-mask-leave');
this.mask.addEventListener('transitionend', () => {
this.unbindMaskClickListener();
document.body.removeChild(this.mask);
DomHandler.removeClass(document.body, 'p-overflow-hidden');
this.mask = null;
this.destroyModal();
});
}
},
@ -124,6 +121,14 @@ export default {
this.mask.removeEventListener('click', this.maskClickListener);
this.maskClickListener = null;
}
},
destroyModal() {
if (this.mask) {
this.unbindMaskClickListener();
document.body.removeChild(this.mask);
DomHandler.removeClass(document.body, 'p-overflow-hidden');
this.mask = null;
}
}
},
computed: {