From 78a34bbd4be7df6f14653ed0f041b93e880e3a4b Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Mon, 5 Oct 2020 15:25:19 +0200 Subject: [PATCH] Fix modal freeze Signed-off-by: Richard Steinmetz --- src/components/Modal/Modal.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Modal/Modal.vue b/src/components/Modal/Modal.vue index 37e446ad4c..ecc6c6c35f 100644 --- a/src/components/Modal/Modal.vue +++ b/src/components/Modal/Modal.vue @@ -324,6 +324,8 @@ export default { }, beforeDestroy() { window.removeEventListener('keydown', this.handleKeydown) + this.mc.off('swipeleft swiperight') + this.mc.destroy() }, mounted() { this.showModal = true @@ -339,9 +341,8 @@ export default { // force mount the component to body document.body.insertBefore(this.$el, document.body.lastChild) }, - unmounted() { - this.mc.off('swipeleft swiperight') - this.mc.destroy() + destroyed() { + this.$el.remove() }, methods: {