Skip to content

dashtable with pagination: tooltips appear in wrong place #1848

Closed as not planned

Description

@HeinerTholen

Describe your context

  • packages
dash                              2.0.0
dash-auth                         1.4.1
dash-colorscales                  0.0.4
dash-daq                          0.5.0
dash-renderer                     1.9.1
  • It's frontend related:

    • OS: MacOS 11 (Big Sur)
    • Browser: Firefox
    • Version 94.0.2

Describe the bug

When using dashtable pagination together with tooltips, then the tooltips only appear correctly on page one. On all other pages, the tooltip appears in the top left of the table (see screenshot).

This bug might be connected to row_index more generally. We found that style_data_conditional using row_index to specify the row of a table doesn't work on pages 2+ either.

Expected behavior

Tooltips should appear at the correct position.n all pages of a paginated dash-tables.

Screenshots

dash-table-bug

Activity

  1. adlerberg0 commented on Feb 8, 2022

    @adlerberg0

    There is a pull request related to this issue in plotly/dash-table repo but it wasn't merged. Could it be copied to current repository?
    plotly/dash-table#906

  2. alexcjohnson commented on Feb 10, 2022

    @alexcjohnson
    Collaborator

    Looks like plotly/dash-table#906 has some open items but should be relatively straightforward to bring it over here and finish it - if anyone would like to give it a shot we'd be happy to help get it finished 😄

  3. tlinnet commented on Feb 21, 2022

    @tlinnet

    I also see this problem. The many first items in page 1 is working.
    But when scrolling down, it gets more weird?

  4. kenshima4 commented on Sep 13, 2023

    @kenshima4
    Contributor

    Hi can I have a crack at finishing this?

  5. self-assigned this
    on Jul 25, 2024
  6. removed their assignment
    on Aug 2, 2024
  7. changed the title [-][BUG] dashtable with pagination: tooltips appear in wrong place[/-] [+]dashtable with pagination: tooltips appear in wrong place[/+] on Aug 13, 2024
  8. sakshamgumber commented on Sep 17, 2024

    @sakshamgumber

    is there issue still there to fix it

  9. nielsvth commented on Jan 6, 2025

    @nielsvth

    Any progress on this topic? This creates a table that replicates the issue.
    On page 2 of the paginated table, the tooltip positioning is wrong.

    `import dash
    import dash_table
    from dash import html

    data = [
    {"ID": i, "Name": f"Item {i}", "Description": f"This is item {i}."}
    for i in range(1, 11)
    ]

    app = dash.Dash(name)

    app.layout = html.Div([
    dash_table.DataTable(
    id="simple-table",
    columns=[
    {"name": "ID", "id": "ID"},
    {"name": "Name", "id": "Name"},
    {"name": "Description", "id": "Description"}
    ],
    data=data, # All data
    page_size=5, # Page size is 5
    page_current=0, # Initial page is the first one
    tooltip_data = [
    {
    'Description': {
    'value': row['Description'],
    'type': 'markdown'
    }
    } for row in data
    ],
    tooltip_delay=0,
    tooltip_duration=None,
    ),
    ])

    if name == "main":
    app.run_server(debug=False)`

  10. nielsvth commented on Jan 7, 2025

    @nielsvth

    For those seeking a quick workaround. It is possible to insert html into the dash cell content (and include the appropriate css). This can make a tooltip appear when hovering on the cell content. It works fine with paginated dash tables. Image

  11. kenshima4 commented on Jan 7, 2025

    @kenshima4
    Contributor

    @nielsvth I thought this was closed, @sakshamgumber if you'd like to have a crack at it, please go ahead, I'm working on the layout issue.

  12. AnnMarieW commented on Sep 21, 2026

    @AnnMarieW
    Collaborator

    Since this was reported, DataTable has been deprecated and we recommend using Dash AG Grid

    This example demonstrates that the tooltip is in the correct position on all pages when using Dash AG Grid.

    More information on Tooltips in the dash docs:
    https://dash.plotly.com/dash-ag-grid/tooltips

    If you have questions about migrating to Dash AG Grid, please ask on the Plotly Community Forum.

    import dash
    import dash_ag_grid as dag
    from dash import html
    
    data = [
        {"ID": i, "Name": f"Item {i}", "Description": f"This is item {i}."}
        for i in range(1, 200)
    ]
    
    app = dash.Dash()
    
    app.layout = html.Div(
        [
            dag.AgGrid(
                id="simple-table",
                columnDefs=[
                    {"field": "ID"},
                    {"field": "Name" },
                    {"field": "Description", "tooltipField": "Description"},
                ],
                rowData=data,
    
                dashGridOptions={
                    "tooltipShowDelay": 0,
                    "tooltipHideDelay": 100000,
                    "pagination" :True,
                },
            ),
        ]
    )
    
    if __name__ == "__main__":
        app.run(debug=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething brokendash-data-tablerelated to DataTable componentgood first issuesuitable for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions