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've only tested this in Edge and IE, but using this polyfill turns this:
<details open>
<summary>Open details</summary>
Show raw text<span> and text in elements</span>.
</details>
<details>
<summary>Closed details</summary>
Show raw text<span> and text in elements</span>.
</details>
Text outside the details.
into this:
▼Open details
Show raw text and text in elements.
►Closed details
Show raw text.
Text outside the details.
instead of the expected:
▼Open details
Show raw text and text in elements.
►Closed details
Text outside the details.
The text was updated successfully, but these errors were encountered:
Since CSS can only target element nodes, the polyfill would need to wrap all text nodes in an element like <span> or <div>. For now, you can work around this by always using a container element. For example:
<details><summary>Closed details</summary><div>
Show raw text<span> and text in elements</span>.
</div></details>
@javan Thanks for the polyfill.But this will fail even without raw text. If the element(s) following the summary override the display property and their css selector has a higher specificity. Maybe !important would be a nice addition:
I've only tested this in Edge and IE, but using this polyfill turns this:
into this:
instead of the expected:
The text was updated successfully, but these errors were encountered: