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

Headers aren't aligned with columns with fixed_rows #777

Closed
chriddyp opened this issue May 9, 2020 · 5 comments · Fixed by #793
Closed

Headers aren't aligned with columns with fixed_rows #777

chriddyp opened this issue May 9, 2020 · 5 comments · Fixed by #793
Assignees

Comments

@chriddyp
Copy link
Member

chriddyp commented May 9, 2020

Related to #775 and #776

I can reproduce this after resizing my window, however I can't reproduce it on first draw. A user from the community can though:

https://community.plotly.com/t/dash-1-12-datatable-format-issues-when-using-fixed-header/39120

image

@chriddyp chriddyp added the bug label May 9, 2020
@chriddyp
Copy link
Member Author

chriddyp commented May 9, 2020

As per the community member, this is indeed a regression:

Indeed the bug is exclusive to Dash 1.12. Ran the same code with Dash 1.11 and the format looks correct:

image

So, we'll need to fix this in a patch release @Marc-Andre-Rivet @plotly/dash-core

@chriddyp
Copy link
Member Author

I see this in the dash-docs Percy images too
image

@michaelbabyn
Copy link

Another issue that came up in 1.12.0 was that when there are a lot of columns and horizontal scrolling is necessary the data cells scroll but the headers don't.

import dash
import dash_table
import pandas as pd

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')

app = dash.Dash(__name__)

app.layout = dash_table.DataTable(
    columns=[{"name": i, "id": i} for i in list(df.columns) * 3],
    data=df.to_dict('records'),
    fixed_rows={'headers': True},
    style_cell={'minWidth': '180px', 'width': '180px', 'maxWidth': '180px'},
)

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

Peek 2020-05-14 18-05

@adrianoesch
Copy link

ran into the same issue (header not aligned). a simple window.dispatchEvent(new Event('resize')); does the trick for me.

@michaelbabyn
Copy link

michaelbabyn commented May 29, 2020

Note @plotly/dash , as of today this bug is affecting a Dash Enterprise customer They have currently switched to 1.10 to workaround this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants