Open Mottie opened 2 years ago
In the Slack thread on this support issue, @bkjohnson noted that he thought we had some guidance saying that an accordion should have two or more items, but it doesn't seem to be currently in our guidance.
@GnatalieH or @humancompanion-usds, do you have any thoughts on this?
@k80bowman I also believe we should update our guidance to say that accordions should always have two or more items. If someone needs a single expandable content element, they can use Additional info. CC @humancompanion-usds
@Mottie - Can you point us to the instance of a single accordion so I can have a look? Thanks.
Neither we nor USWDS have guidance around a minimum number of Accordions one has to have. I've used single accordions in the past (though I did not have an Additional Info component). I can imagine a use case for a single accordion given that it has much more visual presence than Additional info. Regardless, the 2nd issue mentioned still sounds like a bug either way.
Since that template is setting data-multiselectable
based on a CMS value, a quick fix could be to add the open-single
prop to the accordion if entity.fieldCollapsiblePanelMulti
is false.
The "Expand all" button isn't added if openSingle
is truthy.
Bug Report
What happened
I found 2 minor issues with the
va-accordion
web component.va-accordion-item
within this wrapper, the "Expand all"/"Collapse all" button should be hidden, or update the documentation to describe the usage for only oneva-accordion-item
va-accordion-item
elements inside theva-accordion
are not rendered (or hidden), the "Expand all"/"Collapse all" button should also be hidden.Codesandbox demo showing the issues described above
What I expected to happen
Hide the "Expand all"/"Collapse all" button when one, or less,
va-accordion-item
are visible within the wrapperReproducing
Steps to reproduce:
va-accordion-item