Skip to content

Commit

Permalink
chore: close hover menu option
Browse files Browse the repository at this point in the history
  • Loading branch information
shane-moore committed Jan 2, 2024
1 parent 1325168 commit 072f1fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion layer/components/HoverMenu.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts" setup>
import { useDebounceFn } from '@vueuse/core'
import { ref } from 'vue'
import { Menu } from 'floating-vue'
Expand Down Expand Up @@ -37,6 +38,10 @@ function onUpdate(value: boolean) {
function onToggle() {
isOpen.value = !isOpen.value
}
const closeDebounce = useDebounceFn(() => {
isOpen.value = false
}, 50)
</script>

<template>
Expand All @@ -56,7 +61,7 @@ function onToggle() {

<template #popper>
<div @mouseenter="onMouseEnter" @mouseleave="onMouseLeave">
<slot name="content" />
<slot name="content" v-bind="{ close: closeDebounce }" />
</div>
</template>
</Menu>
Expand Down

0 comments on commit 072f1fb

Please sign in to comment.