Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

noneSelectedText not working in v.1.13.0 #48

Closed
mikeploeger opened this issue Apr 21, 2018 · 3 comments
Closed

noneSelectedText not working in v.1.13.0 #48

mikeploeger opened this issue Apr 21, 2018 · 3 comments
Assignees
Labels

Comments

@mikeploeger
Copy link

mikeploeger commented Apr 21, 2018

Bug:
The noneSelectedText isnt showing up at all.
It has worked in v.1.12.4.

How to reproduce the bug:
HTML:
<select class="btn-group form-control selectpicker m-0" data-show-subtext="true" data-selected-text-format="count" data-live-search="true" multiple="multiple"> <option value="" data-subtext="123" data-tokens="123"> 123 </option> <option value="" data-subtext="123" data-tokens="123"> 123 </option> <option value="" data-subtext="123" data-tokens="123"> 123 </option> <option value="" data-subtext="123" data-tokens="123"> 123 </option> </select>
JS:
$('.selectpicker').selectpicker({ size: 8.4, noneSelectedText: '<span class="placeholder">Choose multiple</span>', });

1.12.4 output is like this:
<button type="button" ... title="Choose multiple" ...><span class="filter-option pull-left"><span class="placeholder">Choose multiple</span></span>&nbsp;<span class="bs-caret"><span class="caret"></span></span></button>

1.13.0 output is like this:
<button type="button" ... title ...><div class="filter-option"><div class="filter-option-inner"><div class="filter-option-inner-inner"></div></div> </div><span class="bs-caret"><span class="caret"></span></span></button>

So "Choose multiple" doesnt get set, nor in the title or the element itself inside the button.
Does somebody know how to fix this?

@caseyjhol caseyjhol self-assigned this Apr 21, 2018
@mikeploeger
Copy link
Author

Am I right that the 'title' option behaves exactly the same as 'noneSelectedText'?
In all examples I could think of, I can replace noneSelectedText with Title in case of a 'multiple' selectpicker.

So maybe you dont have to correct this bug, but instead remove the 'noneSelectedText' option.

@caseyjhol
Copy link
Member

noneSelectedText is the default text used if there aren't any selected options. You are right that the title attribute always overrides noneSelectedText. In a future major release, I'd like to add a new option - "placeholder" - that would be used to set the default text instead of title, and title would then revert to its normal usage (so a static title could be set and would not be overwritten when options are selected).

@caseyjhol
Copy link
Member

Fixed and released in v1.13.1!

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

No branches or pull requests

2 participants