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

SkipLink produces invalid HTML when used within a paragraph (<p> cannot appear as a descendant of <p>) #2574

Closed
unekinn opened this issue Oct 5, 2024 · 1 comment · Fixed by #2577
Assignees
Labels
🐛 bug Something isn't working

Comments

@unekinn
Copy link
Contributor

unekinn commented Oct 5, 2024

Version number

No response

Description of the bug

The SkipLink documentation in Storybook demonstrates the problem. The following error message is shown in the console:

Warning: validateDOMNesting(...): <p> cannot appear as a descendant of <p>.
p
a
SkipLink
p
Paragraph
div
...

Steps To Reproduce

  1. Run the Storybook locally
  2. Go to http://localhost:6006/?path=/docs/komponenter-skiplink--docs
  3. Open the console
  4. Observe the error message

Additional Information

No response

@unekinn unekinn added the 🐛 bug Something isn't working label Oct 5, 2024
@Barsnes
Copy link
Member

Barsnes commented Oct 7, 2024

Our skiplink does perhaps not need to use a paragraph? 🤔
I don't see this being a huge issue outside of our stories, but I propose we change the markup of the skiplink to this:

<a>
  <span>...</span>
</a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants