On <select> controls, there is currently no way to precisely set title attributes of <option> elements and control precisely what is in them.
I worked around this by using a custom form control that duplicates the template and then customizes it for this bit. Which I think is unoptimal.
(There is a way to get title-attributes on <option> elements, but it requires the use of the OptGroup class, which is a completely different beast and still doesn't give precise control over the title attribute of the option elements alone (and adds the <optgroup> elements, which we don't want)
I'm not sure what the best way to do this would be, my workaround was to use a triple of (label, value, title) instead of the tuple that is used right now.
What would you guys be willing to accept? How would you give control to the user for this?
(I am of course aware that most browser don't render title attributes on <option> elements, however we are transforming the <select> elements with select2 afterwards - also the select2 template you provide also doesn't allow to control title attributes.)
On
<select>controls, there is currently no way to precisely settitleattributes of<option>elements and control precisely what is in them.I worked around this by using a custom form control that duplicates the template and then customizes it for this bit. Which I think is unoptimal.
(There is a way to get
title-attributes on<option>elements, but it requires the use of the OptGroup class, which is a completely different beast and still doesn't give precise control over thetitleattribute of the option elements alone (and adds the<optgroup>elements, which we don't want)I'm not sure what the best way to do this would be, my workaround was to use a triple of
(label, value, title)instead of the tuple that is used right now.What would you guys be willing to accept? How would you give control to the user for this?
(I am of course aware that most browser don't render
titleattributes on<option>elements, however we are transforming the<select>elements with select2 afterwards - also the select2 template you provide also doesn't allow to controltitleattributes.)