Hi DeBao Chua,
Thanks for contacting Syncfusion support.
We understood your requirement to use HTML element ad Accordion Panel instead of AccordionItemsDirective.
Please note that the “expanded” API is applicable only for AccordionItemsDirective and it does not support HTML elements and the Accordion panel will not expand based on the ClassName property.
However, you could achieve this requirement by using expandItem method as given in the below code snippet.
- Bind the created event to the Accordion control
<AccordionComponent id="accordion" ref={accordion => this.accordionInstance = accordion!} heightAdjustMode='Auto' overflowMode="Scrollable" className="e-fill" created ={this.oncreated.bind(this)}>
2. In created event, enable the expandItem method to expand to first item.
public oncreated(e: CreatedEventArgs) {
this.accordionInstance.expandItem(true,0) // expand the first item
}
For your reference, we have created a sample with HTML elements instead of Directive. Please check.
Please let us know if you have any further queries.
Regards,
Deepa L.