inertia icon indicating copy to clipboard operation
inertia copied to clipboard

Conflict between Inertia-router and `scroll-behavior: smooth`

Open mrleblanc101 opened this issue 1 year ago • 0 comments

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

mrleblanc101 avatar Jul 14 '24 02:07 mrleblanc101