Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Autohide dbc.Tooltips not working as expected

$
0
0

I’m trying to set up a switch to toggle all tooltips. I thought dbc.Tooltip’s property autohide would be what I waslooking for but no.
Here’s a minimal example of what I tried:


import dash
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_daq as daq

app = dash.Dash(external_stylesheets=[dbc.themes.BOOTSTRAP])

app.layout = html.Div([
    html.Div('Hallo', id='div-hallo'),
    dbc.Tooltip('HALLO!', target='div-hallo', id='tt-hallo'),
    daq.BooleanSwitch(id='toggle-tooltips')
])


@app.callback(Output('tt-hallo', 'autohide'),
              Input('toggle-tooltips', 'on'))
def _toggle_tooltip(toggle):
    return toggle


if __name__ == "__main__":
    app.run_server(debug=True)

9 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images