Skip to content

Commit

Permalink
feat: prevent scroll on router replace in builder component
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Dec 29, 2024
1 parent 23970ed commit 7966cc9
Show file tree
Hide file tree
Showing 2 changed files with 3,014 additions and 2,465 deletions.
4 changes: 2 additions & 2 deletions app/(main)/builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function Builder() {
}
})
_repos.forEach((repo) => params.append("repo", repo))
router.replace(`${pathname}?${params.toString()}`)
router.replace(`${pathname}?${params.toString()}`, { scroll: false })
}
const svg = useMemo(() => {
const params = [] as string[]
Expand All @@ -101,7 +101,7 @@ export function Builder() {
} else {
params.set(key, value)
}
router.replace(`${pathname}?${params.toString()}`)
router.replace(`${pathname}?${params.toString()}`, { scroll: false })
}
const inputDom = (
<>
Expand Down
Loading

0 comments on commit 7966cc9

Please sign in to comment.