From e53222d632d7a6d59ee3308dddf123ba91df9cda Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 10 Sep 2026 17:15:36 +0300 Subject: [PATCH] fix chromium --- src/composables/useScrollPosition.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/composables/useScrollPosition.js b/src/composables/useScrollPosition.js index 1cf337314..d32f6a261 100644 --- a/src/composables/useScrollPosition.js +++ b/src/composables/useScrollPosition.js @@ -29,22 +29,19 @@ export function useScrollPosition() { const scrollIntoView = async (element, options) => { if (element == null) throw new TypeError(`Element is ${element}!`) inProgress.value = true - let call = element.scrollIntoViewIfNeeded - if (!call) { - call = (options) => { - const { height: windowHeight } = useWindowSize() - const { top, height } = element.getBoundingClientRect() - const bottom = top + height + 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) { - element.scrollIntoView(options) - } + const biggerThanScreen = height > windowHeight + const aboveTop = top < 0 + const belowBottom = bottom > windowHeight.value + if (aboveTop || belowBottom || biggerThanScreen) { + await element.scrollIntoView(options) } } - await call(options) + await element.scrollIntoViewIfNeeded(options) inProgress.value = false }