fix(Calendar): rendering fails in some cases (#6812)

This commit is contained in:
neverland
2020-07-18 18:53:40 +08:00
committed by GitHub
parent 3c223ba7f7
commit e541260ef3
2 changed files with 7 additions and 5 deletions
+4 -1
View File
@@ -40,7 +40,10 @@ export function getScroller(el: HTMLElement, root: ScrollElement = window) {
}
export function getScrollTop(el: ScrollElement): number {
return 'scrollTop' in el ? el.scrollTop : el.pageYOffset;
const top = 'scrollTop' in el ? el.scrollTop : el.pageYOffset;
// iOS scroll bounce cause minus scrollTop
return Math.max(top, 0);
}
export function setScrollTop(el: ScrollElement, value: number) {