Open thdoan opened 9 years ago
I just came here to open an issue about this. This is needed. It also forces more complicated error checking since the first option is being selected, instead of none.
A workaround I just found is to add the first option as:
<option data-hidden="true">Select an option ...</option>
See #639
Well, yes, but the docs are misleading: http://silviomoreto.github.io/bootstrap-select/#titleMultiples ... the "title" attribute alone does nothing.
See 0351bd8960f02a7e2cd775fab1308ffa00b4f085.
Neither the linked PR nor the linked commit seem to address the original issue. The title
attribute is not being copied over.
If I have a select
tag:
<select title="Some title">...</select>
I'd expect (based on this comment in the source) the generated button to be:
<button title="Some title" data-toggle="dropdown" ...>
But it does not seem to work.
I've not been keeping track of the main branch because I had already fixed this issue (along with some other enhancements) in my fork way back. You can see a demo of the new title attribute behavior here (under Single Select):
I think we need to add support for a separate placeholder
attribute.
The placeholder
option was added in https://github.com/snapappointments/bootstrap-select/releases/tag/v1.14.0-beta and existing title
functionality has been deprecated.
It seems like the plugin is ignoring the 'title' attribute in the select tag and instead setting the title to the value of the currently selected option. Having the title tooltip set to the currently selected option is not very useful since the user can already see the value that's currently selected. It would be better to honor the title attribute in the select tag if it exists.