Skip to content

Commit

Permalink
Fixed #869 - Sidebar Mask not being removed from DOM
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jan 20, 2021
1 parent bb49c9f commit e6a02b2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/components/sidebar/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default {
mask: null,
maskClickListener: null,
beforeUnmount() {
this.unbindMaskClickListener();
this.destroyModal();
},
methods: {
hide() {
Expand Down Expand Up @@ -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();
});
}
},
Expand All @@ -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: {
Expand Down

0 comments on commit e6a02b2

Please sign in to comment.