Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensures App Router Link respects scroll-behavior: smooth when only ha…
…sh is changed. (#54243) Fixes #54240 The Link component in App Router is not respecting `scroll-behavior: smooth` when only the hash changes. It appears to be caused by `focusAndScrollRef.onlyHashChange = false` being set before `handleSmoothScroll` is called, causing `htmlElement.style.scrollBehavior` to be overridden to `auto` before `scrollIntoView` is called. Moving `focusAndScrollRef.onlyHashChange = false` to after `handleSmoothScroll` invocation resolves the issue.
- Loading branch information