fix(router): skip scroll-to-top on initial navigation when hydrating#68174
Draft
arturovt wants to merge 1 commit intoangular:mainfrom
Draft
fix(router): skip scroll-to-top on initial navigation when hydrating#68174arturovt wants to merge 1 commit intoangular:mainfrom
arturovt wants to merge 1 commit intoangular:mainfrom
Conversation
When scrollPositionRestoration is enabled and the app hydrates an SSR-rendered page, RouterScroller was unconditionally scrolling the viewport to [0, 0] on the first imperative navigation. This discards any scroll position the user established while the server-rendered page was loading. Fix by injecting IS_HYDRATION_DOM_REUSE_ENABLED into RouterScroller and suppressing the scroll-to-top for the initial navigation only. Subsequent navigations are unaffected. Closes angular#64578
Contributor
|
Woah, looks like you've opened a lot of issues/PRs recently. While we appreciate contributions from the community, triaging and reviewing a large influx of content in a short time period takes time away from other ongoing projects. As a result, we're closing these issues/PRs to maintain the team's focus. Note that this is not necessarily a rejection of the goals or direction of any of these contributions in particular, so much as a reflection of the team's current capacity and priorities. You are welcome to open a smaller subset of issues/PRs in accordance with our policy focused on the most important and impactful contributions and we will do our best to prioritize a response as soon as possible. |
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.
When scrollPositionRestoration is enabled and the app hydrates an SSR-rendered page, RouterScroller was unconditionally scrolling the viewport to [0, 0] on the first imperative navigation. This discards any scroll position the user established while the server-rendered page was loading.
Fix by injecting IS_HYDRATION_DOM_REUSE_ENABLED into RouterScroller and suppressing the scroll-to-top for the initial navigation only. Subsequent navigations are unaffected.
Closes #64578