Cleanup listeners on unmount

This commit is contained in:
Benjamin Lu
2025-12-13 19:33:49 -08:00
parent d48aabbe4c
commit 7c5859e186

View File

@@ -138,7 +138,7 @@
</template>
<script setup lang="ts">
import { computed, nextTick, ref, watch } from 'vue'
import { computed, nextTick, onBeforeUnmount, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import IconButton from '@/components/button/IconButton.vue'
@@ -248,6 +248,11 @@ const onIconLeave = () => scheduleHidePreview()
const onPreviewEnter = () => scheduleShowPreview()
const onPreviewLeave = () => scheduleHidePreview()
onBeforeUnmount(() => {
clearPreviewHideTimer()
clearPreviewShowTimer()
})
const popoverPosition = ref<{ top: number; right: number } | null>(null)
const updatePopoverPosition = () => {