Skip to content

Commit c07c195

Browse files
Scroll highlighted element into view
1 parent 47489ac commit c07c195

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/components/VisualTour/VisualTour.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const VisualTour = ({
5959
const elementToHighlight = !!step.highlightElementQuery && document.querySelector(step.highlightElementQuery);
6060
if (elementToHighlight) {
6161
elementToHighlight.classList.add(highlightElementClass);
62+
elementToHighlight.scrollIntoView();
6263
}
6364
const titleSuffix = ` ${currentStepIndex + 1} / ${steps.length}`;
6465
const actionButtons = [

0 commit comments

Comments
 (0)