🎨 Improve code formatting and readability in scroll position calculation logic

This commit is contained in:
2026-01-28 21:18:02 +00:00
parent 1a398b2528
commit 6bf6bb3a1c

View File

@@ -767,7 +767,8 @@ function scrollToResult() {
const containerHeight = scroller.$el.clientHeight; const containerHeight = scroller.$el.clientHeight;
// Calculate scroll position to center the item // Calculate scroll position to center the item
const targetScrollTop = (lineIndex * itemHeight) - (containerHeight / 2) + (itemHeight / 2); const targetScrollTop =
lineIndex * itemHeight - containerHeight / 2 + itemHeight / 2;
// Use the scroller's internal scrollTop // Use the scroller's internal scrollTop
scroller.$el.scrollTop = Math.max(0, targetScrollTop); scroller.$el.scrollTop = Math.max(0, targetScrollTop);