fix: restore expected scroll behavior during route navigation - #290
Merged
David1984TK merged 3 commits intoJul 31, 2026
Merged
Conversation
|
@Francisasala is attempting to deploy a commit to the david1984tk's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Praizfotos Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Praizfotos
force-pushed
the
fix/scroll-to-top-route-navigation
branch
from
July 31, 2026 03:37
f615aa9 to
e889fa0
Compare
David1984TK
approved these changes
Jul 31, 2026
David1984TK
left a comment
Owner
There was a problem hiding this comment.
Fix legítimo del comportamiento estándar de scroll en SPAs con react-router: sin esto, navegar entre rutas mantiene el scroll donde estaba en vez de resetear a top. Cambio chico, acotado, CI real en verde. Aprobado.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #246
This PR improves navigation by resetting the scroll position to the top of the page whenever users navigate to a new route, while preserving the browser's native scroll restoration behavior for Back and Forward navigation.
Problem
Previously, navigating between routes preserved the previous page's scroll position. For example, opening a project after scrolling to the bottom of the project list caused the detail page to open halfway down instead of starting at the top.
Solution
Introduced a lightweight
ScrollToTopcomponent inbimex-frontend/src/App.jsx.Behavior:
(0, 0)on PUSH navigation.(0, 0)on REPLACE navigation.useNavigationTypefromreact-router-dom.Validation
npm run test:run(139/139 tests passing)npm run buildnpm run lint(no new warnings or errors)Scope