Closed nickretallack closed 9 years ago
Yeah, that's pretty bad. I'll take a look at this soon. I created this project b/c I thought I was going to need it in a product I was working on, but we changed the design, so I never properly tested/completed this. I mean I briefly used it, but didn't do any in depth testing/usage w/ it.
I'll try to clean up the code, use the react lifecycle properly, and add some tests.
I've patched it locally. The problem is obvious when you compare your copy to the original.
I see there are several multiselect implementations in react. What did you end up using instead?
Btw, did you need to modify the original much in order to make it work? One way to fix this would be to just dump in a new version of bootstrap-multiselect, right?
So we ended up just using a homegrown/simple selector that was styled/branded much different. It was basically just a very simple React component that printed an <ul />
. I wrapped the bootstrap-multiselect b/c it was the nicest looking select (with the most options) that I found quickly while I was prototyping (b/c I didn't want to waste too much effort before it went to creative review).
Anyways, to answer your question: yes, I should just add a new version of bootstrap-multiselect. I'll also slightly re-organize the project so that the "react" code is separate from the bootstrap-multiselect that I download.
I'll also stop making so many changes (i.e. worrying about it passing jshint). I ended up doing something similiar w/ https://github.com/skratchdot/react-bootstrap-daterangepicker that worked kind of nicely.
Thanks for bringing this to my attention (and logging the bug). Hopefully it didn't waste too much of your time (or cause you too many problems).
I updated the libs in https://github.com/skratchdot/react-bootstrap-multiselect/commit/7c7ebc4e07161cf0956dbf88f571b54d45667286 which seems to have fixed the issue w/ auto-select not working in the demo.
The commit I made might not be backwards compatible though because I updated the React and Bootstrap versions.
I also didn't change the bulk of my code, so if new options were added in the last 3 months, I didn't update those yet (see: https://github.com/skratchdot/react-bootstrap-multiselect/blob/master/lib/index.js#L13-L16).
Please re-open this if it is still an issue for you.
In fact, it's even broken in the example. If it were working, the "no optgroups" select would load with "One" selected.