Skip to content

Commit ebe276a

Browse files
authored
👌 Change scrollIntoView behaviour to instant (#3)
1 parent 73c084c commit ebe276a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sphinx_peek/assets/sphinx_peek.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ function scrollToContent(iframe) {
214214
return;
215215
}
216216
if (element) {
217-
element.scrollIntoView({ behavior: "auto" });
217+
// see: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView#behavior
218+
element.scrollIntoView({ behavior: "instant" });
218219
} else {
219220
console.warn(`Sphinx Peek: Target does not exist: ${target}`);
220221
// if target link doesn't exist, scroll to the top of the page

0 commit comments

Comments
 (0)