-
Notifications
You must be signed in to change notification settings - Fork 225
Add id
to radioitems.options options so that one can attach tooltips to them
#377
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
Comments
id
to radioitems.options options so that one can attach tooltip to themid
to radioitems.options options so that one can attach tooltips to them
It appears that one does not need id because I found that the
|
That looks like a nice workaround! I'll look at adding |
Adding this in #379, seems to work well 👍 import dash
import dash_bootstrap_components as dbc
app = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])
app.layout = dbc.Container(
[
dbc.RadioItems(
id="radios",
options=[
{"label": f"Item {i}", "value": i, "label_id": f"my-label-{i}"}
for i in range(5)
],
)
]
+ [
dbc.Tooltip(f"Tooltip for item {i}", target=f"my-label-{i}")
for i in range(5)
]
)
if __name__ == "__main__":
app.run_server(debug=True) Will close this when it makes it into a release. |
Great, thank you very much! |
This is now available in version 0.10.1 |
Hi,
Thank you for this fantastic package!
I started to play with the radio items and found that currently it is not easy to add tooltips for the items.
The issue is that
dbc.Tooltip
needs antarget
property but if we use a plaindbc.RadioItems
, the created option items do not have an id.I also tried using the stand alone radio item approach, and I can create the layout as expected, but
I have no idea how to implement the mutually exclusive checking behavior using clientside callbacks (I saw some discussion here #241).
Any suggestions?
The text was updated successfully, but these errors were encountered: