Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selected:true does not work #1

Closed
nickretallack opened this issue Nov 19, 2014 · 4 comments
Closed

selected:true does not work #1

nickretallack opened this issue Nov 19, 2014 · 4 comments

Comments

@nickretallack
Copy link

In fact, it's even broken in the example. If it were working, the "no optgroups" select would load with "One" selected.

@skratchdot
Copy link
Owner

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.

@nickretallack
Copy link
Author

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?

@skratchdot
Copy link
Owner

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).

@skratchdot
Copy link
Owner

I updated the libs in 7c7ebc4 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants