Closed domenic closed 2 years ago
could I interest you in a { scroll: 'auto' } default, that acts like after-transition, unless navigateEvent.scroll() is called before the intercept promise settles?
Hmm, I wonder if we should just make that the behavior of "after-transition"...
Yeah, that makes sense
This changes the default behavior of intercepted navigations with respect to scrolling in the following ways:
This change requires some updated API surface: the scrollRestoration option to intercept() has become scroll, and the navigateEvent.restoreScroll() method has become navigateEvent.scroll(). The latter method now has more capabilities, working to give browser-default-like behavior for "push", "replace", and "reload" in addition to "traverse".
Similar to before, all of this can be opted out of by using scroll: "manual".
Closes #237 by giving an easy default behavior for SPA navigations with hashes.
Closes #231 by making "push", "replace", and "reload" behave by default in an MPA-like manner with respect to scroll position, just like "traverse" does.
Preview | Diff