Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

tooltip={'always_visible': True} doesn't work with slider #640

@jonyow

Description

@jonyow

I get an error when I use the tooltip={'always_visible': True} argument when creating a dash slider in python.

The error only appears when I move the slider.

When I remove the tooltip argument, the code runs fine (but I don't get the tooltip that I need).

# Here's a minimal example that reproduces the error

import dash
import dash_html_components as html
import dash_core_components as dcc

app = dash.Dash(__name__) 
app.layout = html.Div([
    dcc.Slider(
        id='my-slider',
        min=0,
        max=20,
        step=0.5,
        value=5,
        tooltip={'always_visible': True}
    ),
    html.Div(id='output-container-slider')
])

@app.callback(
    dash.dependencies.Output('output-container-slider', 'children'),
    [dash.dependencies.Input('my-slider', 'value')])
def update_output(value):
    return 'You have selected "{}"'.format(value)

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

I would expect the tooltip to show the current value of the slider as it moves and the tooltip to persist even I move the mouse away.

Instead, I get this error:

Failed component prop type: Invalid component prop `tooltip` key `visible` supplied to Slider.
Bad object: {
  "visible": true
}
Valid keys: [
  "always_visible",
  "placement"
]

(This error originated from the built-in JavaScript code that runs Dash apps. Click to see the full stack trace or open your browser's console.)
Error: Failed component prop type: Invalid component prop `tooltip` key `visible` supplied to Slider.

Bad object: {
  "visible": true
}

Valid keys: [
  "always_visible",
  "placement"
]

    at propTypeErrorHandler (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/dash_renderer.dev.js?v=1.0.1&m=1568039086:44125:11)

    at CheckedComponent (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/dash_renderer.dev.js?v=1.0.1&m=1568039086:40498:9)

    at renderWithHooks (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/[email protected]?v=1.0.1&m=1568039086:13073:18)

    at mountIndeterminateComponent (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/[email protected]?v=1.0.1&m=1568039086:15155:13)

    at beginWork (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/[email protected]?v=1.0.1&m=1568039086:15760:16)

    at performUnitOfWork (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/[email protected]?v=1.0.1&m=1568039086:19447:12)

    at workLoop (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/[email protected]?v=1.0.1&m=1568039086:19487:24)

    at renderRoot (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/[email protected]?v=1.0.1&m=1568039086:19570:7)

    at performWorkOnRoot (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/[email protected]?v=1.0.1&m=1568039086:20477:7)

    at performWork (http://127.0.0.1:8050/_dash-component-suites/dash_renderer/[email protected]?v=1.0.1&m=1568039086:20389:7)

Although I pass the correct key {'always_visible': True}, it seems to be getting overridden to 'visible' further down the line.

Metadata

Metadata

Assignees

Labels

dash-type-bugSomething isn't working as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions