Skip to content

Commit c272193

Browse files
committed
use smoother scrolling and place target to the center
1 parent 89f98dd commit c272193

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/VisualTour/VisualTour.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ export const VisualTour = ({
8080
if (elementToHighlight) {
8181
// Typescript for some reason incorrectly infers the type of elementToHighlight as never
8282
(elementToHighlight as HTMLElement).classList.add(highlightElementClass);
83-
(elementToHighlight as HTMLElement).scrollIntoView();
83+
(elementToHighlight as HTMLElement).scrollIntoView({
84+
behavior: "smooth",
85+
block: "center",
86+
});
8487
}
8588
const stepDisplay = (
8689
<Badge tagProps={{ emphasis: "weaker" }} size="large">

0 commit comments

Comments
 (0)