Skip to content

Commit 3e1dece

Browse files
committed
Change URL and param replacement to avoid scroll jumps
1 parent 50eca27 commit 3e1dece

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/app/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ function SearchInterface() {
6868
params.set("q", searchQuery.trim());
6969
}
7070
const newURL = params.toString() ? `/?${params.toString()}` : "/";
71-
router.replace(newURL);
71+
72+
// Use history API to avoid scroll jumps
73+
window.history.replaceState(null, "", newURL);
7274
};
7375

7476
const performSearch = async (searchQuery: string) => {

0 commit comments

Comments
 (0)