Search code examples
reactjssemantic-uisemantic-ui-react

React-Semantic-UI, Accordion, activeIndex with and without "exclusive={false}". Works and doesn't


Expected Result

I need to have a "closeAll" button. But using exclusive={false}, because I need many line opened. It doesn't work.

Actual Result

Just exclusive={true} works.

Version

0.77.2

Testcase

https://codesandbox.io/s/k2wlkoz5wr


Solution

  • The issue is that it's being overwritten by your activeIndex prop.

    Update: You can try this fork of your example.

    The idea is that if you're using exclusive={false} you need to pass activeIndex as an array. Then all you have to do is change the way you update the indexes on the event handlers.