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

Allow 'disabled' property to be toggled #14

Closed netsgnut closed 9 years ago

netsgnut commented 9 years ago

Currently code like the following won't really work:

<Multiselect disabled={ this.state.shouldBeDisabled } />

The reason is that the disabled property has not been translated accordingly for the bootstrap-multiselect plugin to work upon. This PR listens to prop change and call the .multiselect('enable') and .multiselect('disable') accordingly.

Not sure if this is the right pattern to go - I am still getting used to React's pattern. Please feel free to test as well. Thanks.

skratchdot commented 9 years ago

Looks good to me. Thanks for this fix.