Skip to content

Commit

Permalink
fix: replace history entries when searching (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaals authored May 15, 2023
1 parent 4c1b9c8 commit a57f343
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ export default function SearchBar({ searchList }: Props) {
searchParams.set("q", inputVal);
const newRelativePathQuery =
window.location.pathname + "?" + searchParams.toString();
history.pushState(null, "", newRelativePathQuery);
history.replaceState(null, "", newRelativePathQuery);
} else {
history.pushState(null, "", window.location.pathname);
history.replaceState(null, "", window.location.pathname);
}
}, [inputVal]);

Expand Down

0 comments on commit a57f343

Please sign in to comment.