Skip to content

Commit

Permalink
fix(useInfiniteScroll): compatibility issues of getScrollTop in Andro…
Browse files Browse the repository at this point in the history
…id browsers (#2285)

* fix getScrollTop

* feat: fix getScrollTop

---------

Co-authored-by: ljjcherryli <[email protected]>
  • Loading branch information
LJJCherry and ljjcherryli authored Aug 27, 2023
1 parent 185af79 commit 5412bb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hooks/src/utils/rect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const getScrollTop = (el: Document | Element) => {
if (el === document || el === document.body) {
if (el === document || el === document.documentElement || el === document.body) {
return Math.max(
window.pageYOffset,
document.documentElement.scrollTop,
Expand Down

0 comments on commit 5412bb7

Please sign in to comment.