How to prevent Accordion collapse after changing dataSource

Hi Syncfusion Team,
I'm using Accordion to build a feature on my website. By default, after changing dataSource, Accordion collapses all items and expands immediately after that. I want to disable this feature(Accordion will not collapse after changing dataSource).

Link sample: https://stackblitz.com/edit/react-zpehrd?file=index.js
(In sample: please click Activate/Deactivate button to change DataSource)

How I can implement it?


3 Replies 1 reply marked as answer

RM Ruksar Moosa Sait Syncfusion Team August 3, 2022 12:45 PM UTC

Hi Ton,


Greetings from Syncfusion support.


We have validated your shared sample and suggest you disable the accordion animation like the below code to resolve the reported issue.



const animation = { expand: { effect:''duration:0easing:'' }, collapse: { effect:''duration:0easing:'' } };




<AccordionComponent

            dataSource={dataSource}

            headerTemplate={headerTemplate}

            itemTemplate={itemTemplate}

            expanding={expanding}

            animation={animation}

   />


Sample: https://stackblitz.com/edit/react-zpehrd-7sz2pt?file=index.js


Kindly try the above sample and let us know if this meets your requirement.


Regards,

Ruksar Moosa Sait

If this post is helpful, kindly consider accepting it as the solution so that other members can locate it more quickly.


Marked as answer

TT Ton That Hung August 10, 2022 09:47 AM UTC

Oh great, thank you for your support.



RV Ravikumar Venkatesan Syncfusion Team August 11, 2022 04:59 AM UTC

Hi Ton,


Thanks for the update.


We are happy that our solution helped you.


Regards,

Ravikumar Venkatesan


Loader.
Up arrow icon