glennflanagan / react-collapsible

React component to wrap content in Collapsible element with trigger to open and close.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Closing other tabs when opening a new one?

kawern opened this issue · comments

Hi, maybe its just me not reading the docs correctly, but is there a way to close other "tabs" when clicking (opening) a new one?

You can use the open prop to manage the open state of the collapsible, so you'd need to close all other collapsibles from a parent component.

I did create this (but it's not maintained) but it'll give you an idea on how to do it https://github.com/glennflanagan/react-responsive-accordion