skratchdot / react-bootstrap-multiselect

A multiselect component for react (with bootstrap). This is a react port of bootstrap-multiselect.
http://projects.skratchdot.com/react-bootstrap-multiselect/
Other
119 stars 61 forks source link

Partial solution to https://github.com/skratchdot/react-bootstrap-multiselect/issues/7 #8

Closed tomaskikutis closed 9 years ago

tomaskikutis commented 9 years ago

Added syncData method to be called by parent to sync state data with multiselect dropdown checkboxes

skratchdot commented 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!

tomaskikutis commented 9 years ago

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.