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

Wrong timing for scrolling to the top when handling click #751

Open
platosha opened this issue Mar 14, 2022 · 0 comments
Open

Wrong timing for scrolling to the top when handling click #751

platosha opened this issue Mar 14, 2022 · 0 comments

Comments

@platosha
Copy link
Contributor

platosha commented Mar 14, 2022

Noticeable in https://directory.demo.vaadin.com/

Expected behaviour:

  • Click a router link
  • Shows the new page and sets the scroll to the top at the same time

Actual behaviour:

  • Click a router link
  • Scrolls the current page to the top
  • Shows the new page

In addition, scrolling early messes up the browser’s own logic for restoring scroll position when navigating using back/forward buttons. To not interfere, scrolling should happen after the history is updated with a new entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant