Skip to content

Links always scroll to URL hash on hover #5930

@Mario-Eis

Description

@Mario-Eis

Which project does this relate to?

Router

Describe the bug

After an update of react router a bug was introduced to our application. When there is a hash fragment in the URL to scroll to a specific headline, a scroll will be triggered as soon as any react router link on the page is hovered. I pinned it down to the last working version of react router that is 1.134.18. The next version on NPM is 1.134.20, which breaks the behaviour already. So I would suggest, the bug was intoduced in 1.134.19 or 1.134.20

Your Example Website or App

https://stackblitz.com/edit/github-nsuiogjw?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  1. Click on "About" link
  2. Click on "To hash" link
  3. Scroll back up again
  4. Hover the cursor over the "Home" link

Expected behavior

Result will be: Browser scrolls to the hash position
Expected is: No scroll at all when moving the cursor over a link.

Screenshots or Videos

No response

Platform

  • Router Version: 1.134.20 - 1.139.0
  • OS: Windows
  • Browser: Brave
  • Browser Version: latest
  • Bundler: vite
  • Bundler Version: latest

Additional context

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions