Closed tomaskikutis closed 9 years ago
Thanks for this. I was actually just looking into your issue from yesterday. I knew this library wasn't doing things the react way, and had been playing with re-rendering/initializing the multiselect on every render() call- but that might lead to weird issues. I like this approach for the time being. The real solution would be a full react port of the base library, but I'd then have to stop pulling in upstream changes I think.
Thanks for logging this issue, and for making a fix!
You are welcome :) I think porting the whole library is too tedious and gives too little advantage. Another solution I was thinking about is updating the data when dropdown is closed or binding to event to update when it closes if it's open. This would cover most cases automatically and only leave out exotic edge cases where component state is updated without user interaction(pooling, websockets etc) as user clicks on other elements already close dropdown.
Added
syncData
method to be called by parent to sync state data with multiselect dropdown checkboxes