Skip to content
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

[Feature Request] Allow setting the title property of the label surrounding the RadioItem and Checklist choices. #1847

Open
Viech opened this issue Nov 30, 2021 · 2 comments

Comments

@Viech
Copy link

@Viech Viech commented Nov 30, 2021

Is your feature request related to a problem? Please describe.
Radioitem and checklist options typically have short labels so sometimes it would be helpful to add a descriptive tooltip to them. For a user-defined label, this is possible via html.Label(title="…"). For labels created through RadioItem or Checklist, this does not seem possible.

Describe the solution you'd like
In addition to disabled, label, value, allow setting the title on an option.

Describe alternatives you've considered
I've seen a workaround using dbc but apart from requiring the bootstrap components, that solution is somewhat complicated and does not match the workflow of the html.Label component.

@Viech Viech changed the title [Feature Request] Allow setting the 'title' property of the label surrounding the RadioItem and Checklist choices. [Feature Request] Allow setting the title property of the label surrounding the RadioItem and Checklist choices. Nov 30, 2021
@Viech Viech changed the title [Feature Request] Allow setting the title property of the label surrounding the RadioItem and Checklist choices. [Feature Request] Allow setting the title property of the label surrounding the RadioItem and Checklist choices. Nov 30, 2021
@LenAnderson
Copy link

@LenAnderson LenAnderson commented Feb 8, 2022

Seems like a bug / overlooked. The doc even mentions explicitly that a title can be set on Checklist options in order to show a tooltip.

https://dash.plotly.com/dash-core-components/checklist#checklist-properties

options is a list of strings | numbers | booleans | dict | list of dicts with keys:
[...]
title (string; optional): The HTML 'title' attribute for the option. Allows for information on hover. For more information on this attribute, see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title.


EDIT:

Unfortunately dbc.Tooltip no longer uses querySelector to find the target but document.getElementById, labelId also no longer exists. So the dbc workaround no longer works either.

@ned2
Copy link
Contributor

@ned2 ned2 commented Apr 2, 2022

Given that the Dash docs (for both Checklist and RadioItems) explicitly state that the title attribute in the list of options will set the title attribute for each HTML option, I wonder if this might be a bug rather than a feature request.

Came looking for an issue along these lines after I discovered this wasn't working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants