[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use invisible header row #1758

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

tmpacifitech
Copy link
Contributor

Copy link
Contributor
@akksi akksi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It kind of works, but it's quite flickery/laggy and sometimes unresponsive when scrolling vertically or resizing the window.

data-table_screencast.mp4

I'm not sure how much work it would take, but maybe it would be worth restructuring the HTML table markup a bit (by joining the header and the body part to one table) to render a semantic table and format it with CSS instead of calculating the column sizes with js.

If not, maybe it's possible to optimize the calculations a bit more.

@akksi
Copy link
Contributor
akksi commented Sep 16, 2021

A lower effort solution could be cloning the header row into the table body and make it visually hidden so it would essentially set the min. width of the columns - in theory.

@tmpacifitech
Copy link
Contributor Author

@akksi can you take a look at this PR again?

@akksi
Copy link
Contributor
akksi commented Sep 19, 2021

Looks good to me. :)

fixed_rows={{headers: true}}
row_deletable={true}
row_selectable='single'
/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Could we add a test where the columns are as wide as max(header, cell)? In this test case, the table is very wide so we don't see the issue of the narrow headers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a test with several columns

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah well I guess this existing test covers it:
image

@chriddyp
Copy link
Member

This percy diff is odd - Looks like we lost the header border for the row selection column?
image

@chriddyp
Copy link
Member

Another odd one - custom colors aren't being applied to that border
image

@chriddyp
Copy link
Member

@chriddyp
Copy link
Member
chriddyp commented Sep 20, 2021

The widths of these columns changed considerably. Not sure what the "true" width should be for this case though.

https://percy.io/plotly/dash-table-test/builds/12769932/changed/721646759?browser=edge&browser_ids=19%2C20%2C21&subcategories=unreviewed%2Cchanges_requested&viewLayout=side-by-side&viewMode=new&width=1280&widths=375%2C1280

DashTable/Markdown: Headers: fixed_rows

image

@alexcjohnson
Copy link
Collaborator

And this one isn't getting rendered

The table percy tests have been flaky for some time now, unfortunately, in exactly this way: some tables just disappear entirely. If we're relying on those tests to validate the changes here, perhaps it's worth spending a little time in a separate PR just getting those tests to be reliable, then rebase this PR on top of that?

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

Successfully merging this pull request may close these issues.

fixed rows - overflow with default settings
4 participants