Skip to content

Combining links and headers breaks details/card component #4369

@kristianeskogvang

Description

@kristianeskogvang

Version number

No response

Description of the bug

If details component contains a header, which in turn contains a link, clicking anywhere on the card component will redirect to the link. So, when attempting to toggle expansion of the accordion (to display details) user is instead redirected to the link in question. This seems to happen regardless of the location of the link/header, and happens with both link elements and html elements

This seems to only happen when the component is wrapped in a card, suggesting it might be related to the link card-funtionality(?)

Steps To Reproduce

Inserting a header element containing a link anywhere in the a details element wrapped in a card causes the whole card to lead to that link

Changing, for instance, the details content from this:
Image
to this:
Image
introduces the issue.

Possible to recreate by just editing the example code on the details component details page

Additional Information

No response

Metadata

Metadata

Labels

🐛 bugSomething isn't working

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions