snapappointments / bootstrap-select

:rocket: The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more.
https://developer.snapappointments.com/bootstrap-select/
MIT License
9.85k stars 2.72k forks source link

Title attribute on select tag not honored #977

Open thdoan opened 9 years ago

thdoan commented 9 years ago

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.

qnxor commented 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.

qnxor commented 9 years ago

A workaround I just found is to add the first option as:

<option data-hidden="true">Select an option ...</option>
caseyjhol commented 9 years ago

See #639

qnxor commented 9 years ago

Well, yes, but the docs are misleading: http://silviomoreto.github.io/bootstrap-select/#titleMultiples ... the "title" attribute alone does nothing.

caseyjhol commented 9 years ago

See 0351bd8960f02a7e2cd775fab1308ffa00b4f085.

nickrivadeneira commented 8 years ago

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.

thdoan commented 8 years ago

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):

http://thdoan.github.io/bootstrap-select/examples.html

caseyjhol commented 8 years ago

I think we need to add support for a separate placeholder attribute.

caseyjhol commented 3 years ago

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.