diff --git a/packages/radix-vue/src/shared/useGraceArea.ts b/packages/radix-vue/src/shared/useGraceArea.ts index 57a96be2d..af4b92c4e 100644 --- a/packages/radix-vue/src/shared/useGraceArea.ts +++ b/packages/radix-vue/src/shared/useGraceArea.ts @@ -59,9 +59,9 @@ export function useGraceArea(triggerElement: Ref, conta pointerExit.trigger() } } - document.addEventListener('pointermove', handleTrackPointerGrace) + triggerElement.value?.ownerDocument.addEventListener('pointermove', handleTrackPointerGrace) - cleanupFn(() => document.removeEventListener('pointermove', handleTrackPointerGrace)) + cleanupFn(() => triggerElement.value?.ownerDocument.removeEventListener('pointermove', handleTrackPointerGrace)) } })