forked from remix-run/react-router
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[changed] Don't update scroll if only query has changed
Previously, the only way to opt out of scroll updates for a route would be by using `ignoreScrollBehavior`. This, however, made it hard to implement arguably the most common use case: resetting scroll when `params` change and preserving it when only `query` changes. This commit completely disables scroll updates when only `query` has changed. This provides a reasonable default behavior and leaves `ignoreScrollBehavior` for more complicated cases. If you'd rather keep the old behavior and reset scroll on query changes, you can either promote `query` variables to be route `params` or reset scroll position yourself in response to `query` changes in route handler's `componentDidUpdate`. Fixes remix-run#432, remix-run#439
- Loading branch information
Showing
2 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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