Skip to content

Commit

Permalink
fix(useScroll) support window in setArrivedState
Browse files Browse the repository at this point in the history
  • Loading branch information
yulj5 committed May 11, 2023
1 parent d525244 commit 07c0aad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/useScroll/index.ts
Expand Up @@ -161,6 +161,9 @@ export function useScroll(
const onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle)

const setArrivedState = (target: HTMLElement | SVGElement | Window | Document | null | undefined) => {
if (target === window)
target = target.document

const el = (
target === document ? (target as Document).documentElement : target
) as HTMLElement
Expand Down

0 comments on commit 07c0aad

Please sign in to comment.