Setting the open
attribute on a <details>
element should open it
#10140
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Given a
<details>
element, adding theopen
attribute should be enough to toggle the element open and display its content.However, the css rules used to toggle the display of the content is not written to allow for that because they are added to and removed from the content element. If, instead, it were part of a selector like
then toggling the
open
attribute would be enough to toggle the display of the content.A specific scenario where this is important is being able to expand the contents of the
<details>
elements before printing. This should be possible through a simple addition of an attribute rather than adding the attribute AND manipulating css.Reproducible demo
No response
Steps to reproduce
<details>
element (or use https://docusaurus.io/docs/markdown-features#details).document.querySelectorAll('details')[0].open = true
)Expected behavior
The
<details>
element should toggle to the open state (displaying its content).Actual behavior
Nothing happens. The contents of the
<details>
element remain hidden.Your environment
Reproducible from https://docusaurus.io/docs/markdown-features#details.
Self-service
The text was updated successfully, but these errors were encountered: