File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/core/src/Tooltip Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,14 @@ export interface TooltipTriggerProps extends PopperAnchorProps {}
10
10
</script >
11
11
12
12
<script setup lang="ts">
13
- import { computed , onMounted , ref } from ' vue'
14
- import { injectTooltipRootContext } from ' ./TooltipRoot.vue'
15
- import { PopperAnchor , type PopperAnchorProps } from ' @/Popper'
13
+ import type { PopperAnchorProps } from ' @/Popper'
14
+ import { PopperAnchor } from ' @/Popper'
16
15
import {
17
16
Primitive ,
18
17
} from ' @/Primitive'
18
+ import { computed , onMounted , ref } from ' vue'
19
19
import { injectTooltipProviderContext } from ' ./TooltipProvider.vue'
20
+ import { injectTooltipRootContext } from ' ./TooltipRoot.vue'
20
21
21
22
const props = withDefaults (defineProps <TooltipTriggerProps >(), {
22
23
as: ' button' ,
@@ -56,6 +57,9 @@ function handlePointerUp() {
56
57
}
57
58
58
59
function handlePointerDown() {
60
+ if (rootContext .open ) {
61
+ rootContext .onClose ()
62
+ }
59
63
isPointerDown .value = true
60
64
document .addEventListener (' pointerup' , handlePointerUp , { once: true })
61
65
}
You can’t perform that action at this time.
0 commit comments