-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
Description
dash 3.2.0
plotly 6.3.0
When using a data table with tooltips assigned, tooltips display at the correct position when native sorting is ascending, but when sorting is set to descending, the tooltips pop up in their old position usually off screen while the data is reversed.
import dash
from dash.dependencies import Input, Output, State
from dash import dcc, html
from dash import dash_table as dt
app = dash.Dash(__name__,
suppress_callback_exceptions=True)
tooltips = [
{'a': {
'type': 'markdown',
'value': '| x | y |\n| :--- | :--- |\n' + '\n'.join([f'| {n} | {n} |' for i in range(10)]) + '\n| | |\n',
}} for n in range(100)
]
app.layout = html.Div([
html.Div(dt.DataTable(
id='datatable',
columns=[
{'name': 'a', 'id': 'a'},
{'name': 'b', 'id': 'b'},
],
data=[{'id': i, 'a': i, 'b': i*2}
for i in range(100)],
tooltip_data=tooltips,
sort_action='native',
), id='datatable-div'),
])
if __name__ == '__main__':
app.run(debug=True)