refactor(notes): restore fixed mobile heights for scroll math
Re-pin .note and .stacked-note to 100dvh on mobile and bring back the container height in useResizeContainer so (index + 1) * height has a reachable scroll target. Switch the polled scroll helper to that same formula instead of offsetTop.
This commit is contained in:
@@ -52,17 +52,17 @@ export const useRouteQueryStackedNotes = () => {
|
||||
index: number,
|
||||
attempts = 30
|
||||
) => {
|
||||
if (attempts <= 0) {
|
||||
scrollToNote((index + 1) * height.value)
|
||||
return
|
||||
}
|
||||
|
||||
const element = document.querySelector(
|
||||
`.note-${cleanNoteId}`
|
||||
) as HTMLElement | null
|
||||
|
||||
if (element) {
|
||||
scrollToNote(element.offsetTop)
|
||||
scrollToNote((index + 1) * element.clientHeight)
|
||||
return
|
||||
}
|
||||
|
||||
if (attempts <= 0) {
|
||||
scrollToNote((index + 1) * height.value)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user