From 307297f83641a3e28312677012f1e00f051e4d49 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 16 Sep 2026 16:13:36 +0300 Subject: [PATCH] cleanup --- src/composables/useScrollPosition.js | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/composables/useScrollPosition.js b/src/composables/useScrollPosition.js index e0613d9fb..6cd2575a1 100644 --- a/src/composables/useScrollPosition.js +++ b/src/composables/useScrollPosition.js @@ -26,25 +26,5 @@ export function useScrollPosition() { inProgress.value = false } - const scrollIntoView = async (element, options) => { - if (element == null) throw new TypeError(`Element is ${element}!`) - inProgress.value = true - if (!element.scrollIntoViewIfNeeded) { - const { height: windowHeight } = useWindowSize() - const { top, height } = element.getBoundingClientRect() - const bottom = top + height - - const biggerThanScreen = height > windowHeight - const aboveTop = top < 0 - const belowBottom = bottom > windowHeight.value - if (aboveTop || belowBottom || biggerThanScreen) { - await element.scrollIntoView(options) - } - } else { - await element.scrollIntoViewIfNeeded(options) - } - inProgress.value = false - } - - return { x, y, scrollBy, scrollIntoView, inProgress } + return { x, y, scrollBy, inProgress } }