Skip to content

Commit 49bfc40

Browse files
committed
fix: update scroll behavior in scrollToElementIfInView function
- Changed the scrollIntoView block option from "center" to "end" to adjust the scroll behavior when targeting elements in the viewport, improving user experience during navigation.
1 parent 444d9a7 commit 49bfc40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/shared/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export function isInViewport(element: HTMLElement) {
289289
export function scrollToElementIfInView(
290290
element: HTMLElement & { scrollIntoViewIfNeeded: () => void }
291291
) {
292-
element.scrollIntoView({ block: "center" });
292+
element.scrollIntoView({ block: "end" });
293293
}
294294

295295
export type PageType = "home" | "tidb" | "tidbcloud" | undefined;

0 commit comments

Comments
 (0)