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

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

Open
Megarsh opened this issue Jul 24, 2024 · 0 comments
Labels
bug Something isn't working core Related to the core Inertia library help wanted Extra attention is needed

Comments

@Megarsh
Copy link

Megarsh commented Jul 24, 2024

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

this.mp4

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

@pedroborges pedroborges added bug Something isn't working core Related to the core Inertia library help wanted Extra attention is needed labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core Related to the core Inertia library help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants