From 3bbeac4be2ec4108e6a78ad7483044aaaf25edfe Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 17 Jul 2023 08:59:47 +0000 Subject: [PATCH] :v: --- packages/frontend/src/components/MkPagination.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/components/MkPagination.vue b/packages/frontend/src/components/MkPagination.vue index 1ea1e48c2c..8d2fdd3d6c 100644 --- a/packages/frontend/src/components/MkPagination.vue +++ b/packages/frontend/src/components/MkPagination.vue @@ -180,6 +180,7 @@ watch([() => props.pagination.reversed, $$(scrollableElement)], () => { if (scrollObserver) scrollObserver.disconnect(); scrollObserver = new IntersectionObserver(entries => { + if (!active.value) return; // activeでない時は触らない console.log('scrollObserver', entries[0].isIntersecting); weakBacked = entries[0].isIntersecting; }, { @@ -221,6 +222,7 @@ watch([$$(weakBacked), $$(contentEl)], () => { console.log('weakBacked watcher add scrollRemove', weakBacked, contentEl); scrollRemove = (() => { const checkBacked = () => { + if (!active.value) return; // activeでない時は触らない backed = !checkTop(TOLERANCE); console.log('checkBacked', backed); }; @@ -487,11 +489,15 @@ function visibilityChange() { } onActivated(() => { + console.log('activated'); active.value = true; - visibilityChange(); + nextTick(() => { + visibilityChange(); + }); }); onDeactivated(() => { + console.log('deactivated'); active.value = false; });