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; }