From b8fc2346971d0690b96752b49343daea42834423 Mon Sep 17 00:00:00 2001 From: mortezaei Date: Mon, 17 Aug 2026 13:39:27 +0330 Subject: [PATCH] fix --- src/components/Componentes/use-sheet-scroll-lock.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/Componentes/use-sheet-scroll-lock.ts b/src/components/Componentes/use-sheet-scroll-lock.ts index 1347dd9..cbd7dbf 100644 --- a/src/components/Componentes/use-sheet-scroll-lock.ts +++ b/src/components/Componentes/use-sheet-scroll-lock.ts @@ -104,16 +104,15 @@ function syncKeyboardShift(height: number) { const activeContent = document.querySelector( '.question-snap-item[aria-current="step"] .question-snap-content', ); - if (!activeContent) return; + const snapList = document.querySelector(".question-snap-list"); + if (!activeContent || !snapList) return; - const visibleBottom = window.innerHeight - height; - const requiredShift = Math.max( - 0, - activeContent.getBoundingClientRect().bottom - visibleBottom + 16, - ); + const contentTop = activeContent.getBoundingClientRect().top; + const targetTop = snapList.getBoundingClientRect().top + 8; + const requiredShift = Math.max(0, contentTop - targetTop); root.style.setProperty( "--question-keyboard-shift", - `${Math.min(requiredShift, height)}px`, + `${requiredShift}px`, ); }