Currently, I am facing issue in React js Chakra UI Accordion. Issue is all items are remain closed by default for mobile responsive only but keep open for desktop and tablet view.
I am not using any different condition for responsive but it behaves differently for mobile view only.
My goal is to all accordion items should open by default.
<Accordion defaultIndex={defaultIndices}>
2
Answers
Assuming that
defaultIndices
is an array, try to addallowMultiple={true}
I think you should do the map on your index of accordion items and chakra ui component will look’s like
[0,1,3,4] – possible to do the map