As of now, when we use lightning:accordion, we will not be able to close a section. The first section will close when we open second section. But I have a requirement where I have to close the first section without opening the second one. How to achieve this?
1 Answer
You can use Lightning Accordion with multiple sections open. Which allow us to close the section without need to open another one
You need to just set an attribute to enable this.
<lightning:accordion
allowMultipleSectionsOpen="true"
onsectiontoggle="{! c.handleSectionToggle }"
activeSectionName="{! v.activeSections }"
>