-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Closed
Labels
bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 16.13.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.0.6
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue
no github link
To Reproduce
- Add Link with href={{ pathname:
/
, hash: "home" }} - add div with id="home"
- clicking on link will not scroll to div
Describe the Bug
Working on a next 13 app using the experimental flag.
Created a header that has 3 next/link elements and the purpose of those 3 links is to set a hash on the URL and scroll to that anchor element.
The issue is that clicking on those links change the URL but does not scroll to the anchor element, but the strange thing is that by manually changing the hash in the URL does in fact trigger that scroll to the anchor element.
Expected Behavior
Links that add hashes to URL should scroll to the anchor element.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
imranbarbhuiya, apriltaoyvr, myl7, grzegorzpokorski, 1943time and 22 more
Metadata
Metadata
Assignees
Labels
bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.