Skip to content

Commit 3f6fe84

Browse files
committed
refactor: update scroll behavior in scrollToElementIfInView function
- Changed the scrollIntoView block option from "center" to "end" to adjust the scrolling behavior, enhancing user experience when navigating to elements in the viewport.
1 parent 91cad60 commit 3f6fe84

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)