-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrolling to top on navigation broke expected existing behavior #25145
Comments
Try setting it to disabled https://next.angular.io/api/router/ExtraOptions#scrollPositionRestoration |
@ericmartinezr |
@dope9967 probably the behavior changed while they were coding it and they forgot to update the docs. Leave the issue open so they can clarify the docs (and land it in the main angular.io website). And regarding your second point it would be nice to open a different issue with a feature request (I'm not yet familiarized with the scroll restoration thing so I'm not sure if that option exists at all or not) Edit: related #24547 |
Fixes angular#25145 FW-305 #resolve
Fixes angular#25145 FW-305 #resolve
Fixes angular#25145 FW-305 #resolve
Fixes angular#25145 FW-305 #resolve
…#25586) Fixes angular#25145 FW-305 #resolve PR Close angular#25586
…#25586) Fixes angular#25145 FW-305 #resolve PR Close angular#25586
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
I'm using navigation to update URL and trigger data reload for pagination, filtering and sorting of data table. On 6.1.0 it scrolls to the top of the page.
Expected behavior
Before 6.1.0, navigation didn't scroll to top and that was good behavior in my case, since I'm only changing table contents, so logically I don't need to scroll to top, I can just stay where the data table is. There should be an option, by providing some
NavigationExtras
or router scroll settings, to choose if you want to scroll to top, or stay where you were.Minimal reproduction of the problem with instructions
Any kind of navigation scrolls to top now, there's no specific code for this issue.
What is the motivation / use case for changing the behavior?
I think there is no reason to not leave an option for things to stay as they were before 6.1.0. Preferably an optional runtime setting. I could implement this in some other way, but I'm not even sure how? Save scroll positions myself and pass them through URL parameters or cookies? Don't use navigation, update URL with
location.go
and usengOnChanges()
to update data? Those don't seem like some kind of "best practices".Environment
The text was updated successfully, but these errors were encountered: