lekoala / bootstrap5-tags

Replace select[multiple] with nices badges for Bootstrap 5
MIT License
150 stars 35 forks source link

Pass through the title attribute for tooltips #113

Closed tim1mw closed 3 weeks ago

tim1mw commented 5 months ago

I have a use case where I need to pass through the title attribute to show tooltips against the dropdown list, however the title attribute seems to get lost. I've had a dig in the code and came up with a very simple patch (attached) that will take the title from the original <option> element and apply it to the containing <li> element of the tag list.

I'm using the <li> instead of the underlying <a> because the tooltips don't work on the <a> tag if the option has been disabled. I'm using the tooltip to explain why the option has been disabled so this is important.

title.patch.txt

lekoala commented 3 months ago

oh i see never thought of that

i did this: https://github.com/lekoala/bootstrap5-tags/commit/a668ad26d174d896d32301cb2ca8a482b186d27c

it basically means the tooltip will appear on the tag and while hovering in the menu seems good to me :) what do you think ?

lekoala commented 3 weeks ago

closing :)