question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

slider tooltip.always_visible doesn't position properly

See original GitHub issue

If I put a slider into a div that has overflow-y=scroll, then the tooltip doesn’t scoll with the slider

Screenshot from 2020-02-06 13-05-47

import dash
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash(
    __name__,
)


app.layout = html.Div([
    html.Div([
        html.Div(dcc.Slider(
            min=0,
            max=100,
            value=65,
            tooltip={'always_visible':True, 'placement':'bottom'}
        ),
        style=dict(height=100))
    ]*5,
    style=dict(maxHeight=300, overflowX='scroll'))
])


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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alb-erandelcastillocommented, Feb 7, 2020

Since dcc.Slider is calling the react tooltip API, what would be the correct container to set for the tooltip when using getTooltipContainer?

0reactions
jdamibacommented, Oct 15, 2020

I’m currently taking a look at this. This is a non-exhaustive list of some things I’m in the process of figuring out:

  • what combination of css rules is leading to this?
    • the tooltips are positioned absolutely in divs that are siblings of the react-entry-point div and have the following style:
position: absolute;
top: 0px;
left: 0px;
width: 100%;
  • identify a combination of css rules that lead to the desired behavior - presumably the tooltip should only be visible when parent slider is visible and the tooltip should scroll with the parent slider has the overflow=y style?
    • make sure the tooltips are relatively placed in the right place in the DOM- they should be children of the slider rc-slider element?
    • make sure they aren’t visible if the parent isn’t visible
  • understand how this bug was fixed in the ant-design component
    • they added a getPopupContainer prop to their slider, which binds the tooltip to document.body()
  • determine how to update dcc_slider to implement the desired behavior - patch dcc_slider or migrate it entirely to another implementation?
    • would this be a breaking change to the slider API? Or are the props the same? Or can we patch any difference in props?
    • is it possible to use the getTooltipContainer prop of react-component/tooltip which react-component/slider depends on to set the DOM element that the tooltip should be a child of? From: https://github.com/react-component/tooltip/issues/41#issuecomment-298435904
Function returning html node which will act as tooltip container. By default the tooltip attaches to the body. If you want to change the container, simply return a new element.
  • could be that we need to make the same edit that the ant component made
Read more comments on GitHub >

github_iconTop Results From Across the Web

material slider and range slider tooltip not always visible
There was no public API to keep the Tooltip always visible using the app:labelBehavior attribute. Below is a workaround using a Reflection:.
Read more >
Tooltip – Carbon Design System
Upon opening, tooltips can detect the edges of the browser to properly be placed in view so the container does not get cutoff....
Read more >
Tooltip | Components - BootstrapVue
Easily add tooltips to elements or components via the component or v-b-tooltip directive.
Read more >
Slider tooltip in modal scrolling with page #13418 - Issuehunt
Create a modal, make height larger then screen size so you are able to scroll, create a slider with the tool tip always...
Read more >
Slider – amCharts 4 Documentation
Slider. Type class. Creates a slider - a version of scrollbar with just one grip. ... Indicates if this element should display a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found