You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I think that auto-opening details when something is targeted inside of it could be very nice.
However, I'm not so sure about opening the details when targeting themselves. I'd say that I'd be all in for summary inside details to be targetable by <label>, so you could either nest whole details inside a label, or connect them via for and id in order to get an outside toggle.
Yeah, I don't think opening the details when the details itself is targeted is great. You can show the requested element already, there's no need to reveal anything!
But also: yes details' open/closed state absolutely should be CSS-controllable.
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.The text was updated successfully, but these errors were encountered: