Skip to content

Anchors opening <details> #3330

@bameyrick

Description

@bameyrick

Might be linking the wrong spec but I think it is this: https://www.w3.org/TR/html51/interactive-elements.html#the-details-element

I have noticed that if an anchor is placed within a closed <details> element and a user clicks on a link to that anchor, nothing happens. This might not be the intended use of the details element, but if this was a valid use case it would be good that when the user navigates to an anchor within a details element, that details element is opened.

Another potential case would be if the id to anchor to was on the details element itself and the user navigated to it then this would open the details element too (although being able to style details to be open as discussed in #2084 would potentially solve this).

An example use case for this functionality would be a feedback link in a header at the top of the page that anchors to a details element in the footer containing the feedback form, or another would be a link referencing an answer within a FAQ section using <details> and <summary> elements for the questions and answers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions