Skip to content

Commit 78a34bb

Browse files
committed
Fix modal freeze
Signed-off-by: Richard Steinmetz <[email protected]>
1 parent 86eff4c commit 78a34bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/Modal/Modal.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ export default {
324324
},
325325
beforeDestroy() {
326326
window.removeEventListener('keydown', this.handleKeydown)
327+
this.mc.off('swipeleft swiperight')
328+
this.mc.destroy()
327329
},
328330
mounted() {
329331
this.showModal = true
@@ -339,9 +341,8 @@ export default {
339341
// force mount the component to body
340342
document.body.insertBefore(this.$el, document.body.lastChild)
341343
},
342-
unmounted() {
343-
this.mc.off('swipeleft swiperight')
344-
this.mc.destroy()
344+
destroyed() {
345+
this.$el.remove()
345346
},
346347
347348
methods: {

0 commit comments

Comments
 (0)