Skip to content

Commit

Permalink
fix(useScroll): support window in setArrivedState (#3086)
Browse files Browse the repository at this point in the history
Co-authored-by: yulj5 <yulj5@asiainfo.com>
  • Loading branch information
smallnine9 and yulj5 committed May 15, 2023
1 parent 31b6626 commit 8855f24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/useScroll/index.ts
Expand Up @@ -162,7 +162,9 @@ export function useScroll(

const setArrivedState = (target: HTMLElement | SVGElement | Window | Document | null | undefined) => {
const el = (
target === document ? (target as Document).documentElement : target
target === window
? (target as Window).document.documentElement
: target === document ? (target as Document).documentElement : target
) as HTMLElement

const { display, flexDirection } = getComputedStyle(el)
Expand Down

0 comments on commit 8855f24

Please sign in to comment.