Replies: 2 comments 4 replies
-
Currently working on this, though my solution is kind of hack-y, as there's no programmatic interface to do this cleanly. |
Beta Was this translation helpful? Give feedback.
-
Here's what I did as a workaround (not necessarily a good way), In the const handleDiscloserChange = (idx) => {
openIndex &&
openIndex !== idx &&
document.getElementById(openIndex).click();
idx === openIndex ? setOpenIndex(null) : setOpenIndex(idx);
}; I have a state for the Please do suggest improvements and better alternative. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi There.
Has anybody successfully implemented a list of disclosures in react, where there only can be one opened disclosure, and the opened will automatically be closed when a new one is opened?
Beta Was this translation helpful? Give feedback.
All reactions