You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
I noticed a bug/glitch when scrolling through a DataTable with a header taller than a single line. What happens is that every time when scrolling all the way to the bottom of the table, the scroll bar (and the view) jumps up a bit. This is annoying and it also makes it hard to read values from the bottom of the table. Interestingly, the bug does not occur when the table header only has one line.
importdashimportdash_tableimportpandasaspddf=pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')
# duplicating rows to make the table longerdf=df.append([df]*20, ignore_index=True)
# renaming one column to have a long name so that table header does not fit on one rowdf.rename(columns={'State': 'State State State State State State State State State State'}, inplace=True)
app=dash.Dash(__name__)
app.layout=dash_table.DataTable(
id='table',
columns=[{"name": i, "id": i} foriindf.columns],
data=df.to_dict('records'),
style_header={
'height': 'auto', 'whiteSpace': 'normal', # text wrapping
},
fixed_rows={'headers': True},
style_table={'maxHeight': 600, 'maxWidth': 600}
)
if__name__=='__main__':
app.run_server(debug=True)
The text was updated successfully, but these errors were encountered:
I notest this bug happens when you have fixed headers and they can wrap creating taller cells, in my case the headers have a height of 61px.
You can fix the bouncing of the last row if you set the height of the headers to the be their max height.
In my case: style_header={"maxHeight": "60px", "minHeight": "60px", "height": "60px"}
I have the feeling that, when you have fixed headers, the "tallness" of the header is been calculated with one of the headers cells that doesn't have the max height and that cause the bounce when you focus on the last rows.
Originally reported on community.plotly.com.
I noticed a bug/glitch when scrolling through a DataTable with a header taller than a single line. What happens is that every time when scrolling all the way to the bottom of the table, the scroll bar (and the view) jumps up a bit. This is annoying and it also makes it hard to read values from the bottom of the table. Interestingly, the bug does not occur when the table header only has one line.
Package versions:
OS: various
browser: various
Reproducible example:
The text was updated successfully, but these errors were encountered: