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

<Link> with href="#..." still navigates to home #49722

Closed
1 task done
decepulis opened this issue May 12, 2023 · 2 comments
Closed
1 task done

<Link> with href="#..." still navigates to home #49722

decepulis opened this issue May 12, 2023 · 2 comments
Labels
bug Issue was opened via the bug report template. Navigation Related to Next.js linking (e.g., <Link>) and navigation.

Comments

@decepulis
Copy link
Contributor

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000
    Binaries:
      Node: 16.14.0
      npm: 8.3.1
      Yarn: 1.22.17
      pnpm: 7.12.2
    Relevant packages:
      next: 13.4.3-canary.0
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 4.9.5

Which area(s) of Next.js are affected? (leave empty if unsure)

Routing (next/router, next/navigation, next/link)

Link to the code that reproduces this issue

#43089

To Reproduce

  1. Be on a page other than /
  2. Click a relative anchor link with javascript enabled (e.g., href="#content")

As a sanity check, disable Javascript and click the same link.

Describe the Bug

I think I'm still seeing #43089

Clicking on an anchor link on a page other than home e.g., <Link href="#content" /> takes me to /#content

Expected Behavior

If I am on page /page and click on <Link href="#content" />, I expect to navigate to /page#content

Disabling Javascript produces expected behavior

Which browser are you using? (if relevant)

Arc, Safari, and Chrome @ latest; Firefox Dev

How are you deploying your application? (if relevant)

next start

@decepulis decepulis added the bug Issue was opened via the bug report template. label May 12, 2023
@github-actions github-actions bot added the Navigation Related to Next.js linking (e.g., <Link>) and navigation. label May 12, 2023
@decepulis
Copy link
Contributor Author

Looks like #49521 is working on it.

Similar to #42157 and #44139.

A comment on the first issue -- #42157 (comment) -- describes this exact behavior.

Since it seems like this issue is being tracked in those places, I'm thinkin I should close this as a duplicate.

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. Navigation Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests

1 participant