Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b58430

Browse files
authored
fix(useIntersectionObserver): add Document type for root (#4210)
1 parent 45b187a commit 6b58430

File tree

1 file changed

+2
-2
lines changed
  • packages/core/useIntersectionObserver

1 file changed

+2
-2
lines changed

packages/core/useIntersectionObserver/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface UseIntersectionObserverOptions extends ConfigurableWindow {
1919
/**
2020
* The Element or Document whose bounds are used as the bounding box when testing for intersection.
2121
*/
22-
root?: MaybeComputedElementRef
22+
root?: MaybeComputedElementRef | Document
2323

2424
/**
2525
* A string which specifies a set of offsets to add to the root's bounding_box when calculating intersections.
@@ -70,7 +70,7 @@ export function useIntersectionObserver(
7070

7171
const stopWatch = isSupported.value
7272
? watch(
73-
() => [targets.value, unrefElement(root), isActive.value] as const,
73+
() => [targets.value, unrefElement(root as MaybeComputedElementRef), isActive.value] as const,
7474
([targets, root]) => {
7575
cleanup()
7676
if (!isActive.value)

0 commit comments

Comments
 (0)