Skip to content

Commit 1d1b896

Browse files
committed
Fixes Scroll instantly to next result in Find mode #4661
Navigating between search results in find mode now respects the Vimium setting "Use smooth scrolling".
1 parent 3f4ce86 commit 1d1b896

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

content_scripts/mode_find.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,10 @@ const highlight = (textNode, startIndex, length) => {
475475
const rect = range.getBoundingClientRect();
476476
if (rect.top < 0 || rect.bottom > globalThis.innerHeight) {
477477
const screenHeight = globalThis.innerHeight;
478+
const scrollBehavior = Settings.get("smoothScroll") ? "smooth" : "instant";
478479
globalThis.scrollTo({
479480
top: globalThis.scrollY + rect.top + rect.height / 2 - screenHeight / 2,
480-
behavior: "smooth",
481+
behavior: scrollBehavior,
481482
});
482483
}
483484

0 commit comments

Comments
 (0)