inertia icon indicating copy to clipboard operation
inertia copied to clipboard

Scroll To Text Fragment (#:~:text) not working / inconsistent behavior | Flickering on scrolled page reload

Open Megarsh opened this issue 1 year ago • 0 comments

Version:

  • @inertiajs/vue3 version: 1.2.0

Describe the problem:

Scroll To Text Fragments, which are usually present on SERP top snippets are not working

Default behavior when those snippets are clicked is for the web page to highlight the text and scroll to the highlighted text position. Currently Inertia.js eats up the hash navigation and the page is opened without scrolling, although that behavior is also inconsistent because in some cases it does scroll down after flickering

https://github.com/user-attachments/assets/f86c7ee2-e33e-4a24-91ba-7561ac90c1f4

From my observations disabling swapComponent on handleInitialPageVisit call fixes this issue as well as an inconsistent scroll behavior + flickering when reloading scrolled pages (although I don't know if that will break other internal stuff) image

Steps to reproduce:

This behavior occurs on one of my production projects running Inertia SSR, but here's a minimal reproduction

https://github.com/Megarsh/inertia-issue

Megarsh avatar Jul 24 '24 12:07 Megarsh