Open South-Paw opened 7 years ago
Same issue. I've followed your suggestion and now it works. I'm using React@16.
Sorry. I somehow missed this. Thanks for the great explaination @South-Paw (and the confirmation @ttessarolo)! I haven't really used this project for a long time, so haven't done a very good job at maintaining it. I accept PR's, but will also try to fix this myself if I get some free time on a weekend to work on it.
@skratchdot thanks for your attention and for your time! please let us know if something is gonna change on the official release.
@South-Paw , I followed your suggestions but I am still getting 2 ul, Is there anything to do after comment out that line???
The Problem
I found today that when I use the
multiple
option, the bootstrap-multiselect generates twoul
s for the dropdown of options, with the second being populated by the selectable options.It would seem that with Bootstrap v3 this is not an issue as both of these
ul
s are shown at the same time (the empty one just appears as 2px of borders and is unnoticeable).However if you are using Bootstrap v4, the new dropdown they have implemented only applies styles to the first child
ul
instead of both - meaning that the secondul
containing the options is not shown/visible.The little border there is the empty dropdown list.
Some Details
We use a modified source of this plugin to work around the bootstrap/jQuery requirement (I think this is mentioned in #73 if it matters) so I started off by checking that it is not our changes causing the issue.
It didn't appear to be in our changes so I checked the demo page for this plugin and you can see the issue by inspecting the dom on the multiple select dropdowns (example attached).
I then went and checked that this issue is not from the parent
bootstrap-multiselect
plugin and can confirm that theirmultiple
examples on the demo page do not exhibit this problem.Fixing it
In the in
index.js
and in thecomponentDidMount()
function; there is a call on line 80 to$this.$multiselect.multiselect($this.getOptionsFromProps());
directly followed by a second call to$this.setOptionsFromProps();
.It would seem that the second call there is then building another dropdown list with no items in it.
If we comment out line 81 (the
$this.setOptionsFromProps();
) then the extraul
disappears - the plugin also seems to continue to work fine without this line.Questions
Thanks for you time, keep up the awesome work! 👍