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

Conflict between Inertia-router and scroll-behavior: smooth #1921

Open
mrleblanc101 opened this issue Jul 14, 2024 · 0 comments
Open

Conflict between Inertia-router and scroll-behavior: smooth #1921

mrleblanc101 opened this issue Jul 14, 2024 · 0 comments

Comments

@mrleblanc101
Copy link

mrleblanc101 commented Jul 14, 2024

Version:

  • @inertiajs/vue3 version: 1.2.0

Describe the problem:

In my app, I have a sticky table of content.
When I click one of the anchor link, the page scroll to the anchor target.
If the link does not scroll completely to the top of the page because there is not enough content after it, clicking it again will scroll back to the top of the page instead of staying where it is.

2024-06-05_00 18 49

This only happen when scroll-behavior: smooth is set.
If I remove scroll-behavior, clicking a second time on the link does nothing, which is the correct behavior.

2024-06-05_00 19 34

This does not match the behavior or regular anchor links and I think is a bug.
This can be reproduced on Intertiajs.com if you add the scroll-behavior: smooth.

I have discussed this behavior with @RobertBoes on 06/05/2024 12:21 AM and we have determined that this seems to be a bug in the router. Link to the thread: https://discord.com/channels/592327939920494592/592327939920494594/1247767232046698527

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

No branches or pull requests

1 participant