Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpect scrollBehavior about savedPosition in Safari and Firefox #1431

Open
abitwhy opened this issue Jun 2, 2022 · 1 comment
Open

Unexpect scrollBehavior about savedPosition in Safari and Firefox #1431

abitwhy opened this issue Jun 2, 2022 · 1 comment
Labels
browser quirk Specific to a browser bug Something isn't working has workaround A workaround has been found to deal with the issue

Comments

@abitwhy
Copy link
Contributor

abitwhy commented Jun 2, 2022

Version

4.0.15

Reproduction link

codesandbox.io

Steps to reproduce

  1. Open the minimal reproduction in firefox.
  2. Click the header1.
  3. Click the header2.
  4. Click the header1 agin.
  5. 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.

@posva posva added bug Something isn't working has workaround A workaround has been found to deal with the issue labels Jun 5, 2022
@posva
Copy link
Member

posva commented Jun 5, 2022

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

@posva posva added the browser quirk Specific to a browser label Jun 6, 2022
@posva posva changed the title Unexpect scrollBehavior about savedPosition Unexpect scrollBehavior about savedPosition in Safari and Firefox Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser quirk Specific to a browser bug Something isn't working has workaround A workaround has been found to deal with the issue
Projects
Status: 📆 Planned
Development

No branches or pull requests

2 participants