inertia
inertia copied to clipboard
Conflict between Inertia-router and `scroll-behavior: smooth`
Version:
@inertiajs/vue3version: 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.
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.
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