router
router copied to clipboard
Unexpect `scrollBehavior` about `savedPosition` in Safari and Firefox
Version
4.0.15
Reproduction link
Steps to reproduce
- Open the minimal reproduction in firefox.
- Click the header1.
- Click the header2.
- Click the header1 agin.
- Click the header2 agin.
It also happened in chrome, if you scroll page to the end before click anchor link in step5.
What is expected?
Jump to the correct header.
What is actually happening?
Jump to savedPostion.
It meets code logic, but does not meet the expectations of use.
Notice: I have used CSS scroll-behavior in :root.
This is due to the links being plain links instead of the router link. Using a router link is the workaround. I'm marking this as a bug for the moment because it should be possible to fix by considering pop navigations with unknown navigation direction (delta = 0) as having an invalid scroll key so they never have a saved position