feat: add use-lock-scroll hook

This commit is contained in:
陈嘉涵
2020-01-13 16:37:27 +08:00
parent 0dfce17f6c
commit d9d63959f5
8 changed files with 68 additions and 13 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ type ScrollElement = HTMLElement | Window;
// http://w3help.org/zh-cn/causes/SD9013
// http://stackoverflow.com/questions/17016740/onscroll-function-is-not-working-for-chrome
const overflowScrollReg = /scroll|auto/i;
export function getScrollEventTarget(element: HTMLElement, rootParent: ScrollElement = window) {
export function getScroller(element: HTMLElement, rootParent: ScrollElement = window) {
let node = element;
while (
node &&