From 1294f5f06f159d5f07792499010dd2c669bd7a2e Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 4 Aug 2023 12:56:06 +0000 Subject: [PATCH] :v: --- .../frontend/src/components/MkPopupMenu.vue | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/frontend/src/components/MkPopupMenu.vue b/packages/frontend/src/components/MkPopupMenu.vue index 73484be481..ce0248e235 100644 --- a/packages/frontend/src/components/MkPopupMenu.vue +++ b/packages/frontend/src/components/MkPopupMenu.vue @@ -4,8 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only --> @@ -30,6 +30,7 @@ const emit = defineEmits<{ let modal = $shallowRef>(); const manualShowing = ref(true); +const hiding = ref(false); function click() { close(); @@ -41,22 +42,22 @@ function onModalClose() { function onMenuClose() { close(); - if (manualShowing.value === false) { - // 先にhideが来ていたらclosedを発火 - emit('closed'); - } } -function closed() { - if (manualShowing.value === true) { +function onModalClosed() { + if (!hiding.value) { // hideが来ていない場合のみclosedを発火 emit('closed'); } } +function hide() { + manualShowing.value = false; + hiding.value = true; +} + function close() { - if (!modal) return; - modal.close(); + manualShowing.value = false; }