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

[BUG] title option in options seems to not work. #2794

Open
PatSev opened this issue Mar 13, 2024 · 1 comment
Open

[BUG] title option in options seems to not work. #2794

PatSev opened this issue Mar 13, 2024 · 1 comment

Comments

@PatSev
Copy link

PatSev commented Mar 13, 2024

Describe your context

I would like to display information on hover an element of a checklist, but, it seems that does not work with the option title of options.

options (list of dicts; optional): An array of options.
title (string; optional): The HTML ‘title’ attribute for the option. Allows for information on hover. For more information on this attribute, see title - HTML: HyperText Markup Language | MDN.

Below, this is the version of dash package that I use:
dash 2.14.2
dash-ag-grid 31.0.1
dash-bootstrap-components 1.5.0
dash-bootstrap-templates 1.1.2
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-table 5.0.0

How I use this option :
{
"label": html.Div(['London'], style={'color': 'LightGreen', 'font-size': 20}),
"value": "London",
"title": "test",
},

@CNFeffery
Copy link

@PatSev A more recommended approach is to add a tooltip to the tag of each option:

demo

import dash
from dash import html
import feffery_antd_components as fac

app = dash.Dash(__name__)

app.layout = html.Div(
    [
        fac.AntdCheckboxGroup(
            options=[
                {
                    'label': fac.AntdTooltip(
                        f'Option{i}',
                        title=f'This is Option{i}😉'
                    ),
                    'value': f'Option{i}'
                }
                for i in range(1, 6)
            ]
        )
    ],
    style={
        'padding': 50
    }
)

if __name__ == '__main__':
    app.run(debug=True)
dash==2.16.1
feffery_antd_components==0.3.0rc7

Related component documentation:
https://fac.feffery.tech/AntdTooltip
https://fac.feffery.tech/AntdCheckboxGroup

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

No branches or pull requests

2 participants