Skip to content
New issue

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

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

Already on GitHub? # to your account

1.8.0 does not draw multiselect. #2878

Closed
badfiles opened this issue Aug 31, 2017 · 8 comments
Closed

1.8.0 does not draw multiselect. #2878

badfiles opened this issue Aug 31, 2017 · 8 comments

Comments

@badfiles
Copy link

badfiles commented Aug 31, 2017

<select data-placeholder="(выберите значение)" multiple="multiple" class="chosen-multiselect" tabindex="5" id="id" name="id[]">
....
</select>
<script type="text/javascript">$(".chosen-multiselect").chosen({width: "100%", max_selected_options: 6});</script>

results in

<div class="chosen-container chosen-container-multi" title="" id="id_chosen" style="width: 100%;"><ul class="chosen-choices">
  <li class="search-field">
    <input class="chosen-search-input default" type="text" autocomplete="off" value="(выберите значение)" tabindex="5" style="width: 152.438px;">
  </li>
</ul>
<div class="chosen-drop">
  <ul class="chosen-results"></ul>
</div></div>

chosen-drop and chosen-results are empty.

Tried in latest chrome and firefox.

Falling back to 1.7.0 helps.

@tjschuck
Copy link
Member

1.8.0 does work for multiselects — you can see it working on the demo page. There must be something amiss with your specific setup.

Here's your exact sample code working in a Fiddle: https://jsfiddle.net/75204mbs/1/

Please link to a publicly accessible page or a Fiddle so we can attempt to debug. Closing in the meantime.

@badfiles
Copy link
Author

if options go like this:

<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>

1.7.0 works, 1.8.0 -- empty dropdown box.

@tjschuck
Copy link
Member

Here's a Fiddle showing that exact code working with 1.8.0: https://jsfiddle.net/75204mbs/8/

@tjschuck
Copy link
Member

Check your JS console. Make sure no errors are being thrown there.

@badfiles
Copy link
Author

No errors, I am sorry, but it looks like it does not work only with Russian words.
Try this set.

<option value="v">я</option>
<option value="z">м</option>
<option value="x">и</option>

@tjschuck
Copy link
Member

Now we're getting somewhere! That sounds like it's related to #2821, which should be fixed by #2877. You can continue using 1.7.0 in the meantime, or you can pull down that branch and build Chosen yourself from source to see if that fixes your issue. We're hoping to get #2877 merged and released very soon.

/cc @adunkman

@badfiles
Copy link
Author

thanks

@tjschuck
Copy link
Member

Here's a JSBin with Chosen from that branch and your code that you shared — it seems to be working with that fix: https://jsbin.com/diwaxomuju/edit?html,output

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

No branches or pull requests

2 participants