Skip to content

Commit

Permalink
feat: scrolls to top of page when highlighted word is brought into view
Browse files Browse the repository at this point in the history
  • Loading branch information
deltork committed Mar 28, 2024
1 parent 493a624 commit 43f11f5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ export class ReadAlongComponent {
// scroll vertically (through paragraph) if needed
if (this.inPageContentOverflow(query_el)) {
if (this.autoScroll) {
query_el.scrollIntoView(false);
query_el.scrollIntoView({ block: "start", inline: "nearest" });
if (!this.isScrolling) this.scrollByHeight(query_el);
}
} // scroll horizontal (through paragraph) if needed
Expand Down

0 comments on commit 43f11f5

Please sign in to comment.