From 4552c28e0660040916fa70cb4b875f205a7c9310 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Mon, 2 Aug 2021 19:34:18 -0400 Subject: [PATCH] Prevent the click event from firing on content below modal --- src/components/media_modal/media_modal.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js index 81404ae4..f83fe472 100644 --- a/src/components/media_modal/media_modal.js +++ b/src/components/media_modal/media_modal.js @@ -58,7 +58,12 @@ const MediaModal = { }, methods: { hide () { - this.$store.dispatch('closeMediaViewer') + // HACK: Closing immediately via a touch will cause the click + // to be processed on the content below the overlay + const transitionTime = 100 // ms + setTimeout(() => { + this.$store.dispatch('closeMediaViewer') + }, transitionTime) }, goPrev () { if (this.canNavigate) {