I recently found out that by adding the name attribute to details it will make a group of details elements to behave like accordions.
This attribute enables multiple <details> elements to be connected, with only one open at a time. This allows developers to easily create UI features such as accordions without scripting.
The name attribute specifies a group name — give multiple <details> elements the same name value to group them. Only one of the grouped <details> elements can be open at a time — opening one will cause another to close. If multiple grouped <details> elements are given the open attribute, only the first one in the source order will be rendered open.
I suggest we add the name attribute so only one of the previews is open at a time. Perhaps this should be an option as well in case someone wants to be able to open multiple at the same time and manually close them.
Follow-up to #230 and #229
I recently found out that by adding the
nameattribute todetailsit will make a group ofdetailselements to behave like accordions.I suggest we add the
nameattribute so only one of the previews is open at a time. Perhaps this should be an option as well in case someone wants to be able to open multiple at the same time and manually close them.Follow-up to #230 and #229