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

Scrolling h2-h6 into focus not working (probably because of <NuxtLink> and #anchor links) #1380

Closed
nobkd opened this issue Jul 25, 2022 · 0 comments

Comments

@nobkd
Copy link
Contributor

nobkd commented Jul 25, 2022

Environment

  • Operating System: Linux
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-rc.6
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: modules, content
  • Runtime Modules: @nuxt/[email protected]
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-9pr9pb?file=content%2Findex.md

Using any title tag (## to ###### => h2 to h6) and clicking on the generated id-link.

Describe the bug

Title links don't scroll into focus when clicking on them, probably because NuxtLink is used.

Additional context

As this discussion shows, it's better to use the html anchor tag to link to #id paths because scrolling into view is not working with NuxtLink.

This is a small part from my TOC generation, maybe this can be used somehow

<a :href="`#${link.id}`">{{ link.text }}</a>

Logs

No response

@nobkd nobkd changed the title Scrolling h2-h6 into focus not working (probably because of <NuxtLink> and #id links) Scrolling h2-h6 into focus not working (probably because of <NuxtLink> and #anchor links) Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants