-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow tooltips on <option> #378
Comments
As you found, browser support for Can you provide a link to
Also a couple of screenshots to illustrate what you want would help me visualize the issue. |
I'd be willing to accept a PR, but I personally wouldn't have a use for it. I see too many UX issues with this approach. Would tooltips work on mobile where there is no hover property? And does a tap mean show me the tooltip or select the item? I would suggest instead using either text with tooltips in the form and not on the |
@dwt I would still accept a PR for your workaround. I've done similar things in a custom template with the tuple for a table of checkboxes. The PR would need to include tests and documentation, and probably a matching functional test in deformdemo. Alternatively we will be creating a separate repo under Pylons for the community to contribute their custom widgets with or without tests and documentation. |
I don't have any time for this right now, but if I do get around to work on this again, I'd be happy to provide a pull request. |
On
<select>
controls, there is currently no way to precisely settitle
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 thetitle
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 controltitle
attributes.)The text was updated successfully, but these errors were encountered: