bootstrap-select icon indicating copy to clipboard operation
bootstrap-select copied to clipboard

Title option (placeholder) not working when select element has at least one optgroup element

Open yankarinRG opened this issue 3 years ago • 3 comments

When there is at least one optgroup among the children of the select, the title option (the placeholder text that appears in the select element when it has no value set) stops working and the placeholder takes the value of the first option repeated as many times as there are optgroups.

In a select without optgroup, however, the title option is honored and works correctly.

As a dirty workaraound it is possible to append an <option hidden selected></option> in the option's childerns.

Version used

  • bootstrap-select 1.14.0-beta2
  • bootstrap 5.1.3
  • jquery 3.6.0

Minimal, Reproducible Example

https://jsfiddle.net/pesa27k0/

yankarinRG avatar Apr 22 '22 13:04 yankarinRG

This is fixed in v1.14.0-beta3.

caseyjhol avatar Apr 22 '22 17:04 caseyjhol

Thank you for reaching out. However, this is still not fixed in 1.14.0-beta3 (as of https://github.com/snapappointments/bootstrap-select/commit/04cc1fd5abedc85c449d159d9fa6ea48e2e4a2f7): jsfiddle

yankarinRG avatar Apr 22 '22 19:04 yankarinRG

Ah, you're right - sorry, I misread your description.

caseyjhol avatar Apr 22 '22 20:04 caseyjhol