From af2603ef8a5b962ebe266943a1bcc725effda4ff Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 5 Feb 2022 02:50:53 +0900 Subject: [PATCH] fix once --- packages/client/src/scripts/scroll.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/scripts/scroll.ts b/packages/client/src/scripts/scroll.ts index b8dadc35a..d65a830d7 100644 --- a/packages/client/src/scripts/scroll.ts +++ b/packages/client/src/scripts/scroll.ts @@ -29,7 +29,7 @@ export function onScrollTop(el: HTMLElement, cb: Function, asobi: number = 1, on // とりあえず評価してみる if (isTopVisible(el)) { cb(); - return null; + if (once) return null; } const container = getScrollContainer(el) || window; @@ -53,7 +53,7 @@ export function onScrollBottom(el: HTMLElement, cb: Function, asobi: number = 1, // とりあえず評価してみる if (isBottomVisible(el, asobi, container)) { cb(); - return null; + if (once) return null; } const containerOrWindow = container || window;