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

fix: Make table header sticky #786

Merged
merged 1 commit into from
Feb 15, 2024
Merged

fix: Make table header sticky #786

merged 1 commit into from
Feb 15, 2024

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Jan 19, 2024

Slightly different approach for #342 to contribute to #631 making the table column header sticky.

Ideally we would have a combination of absolute positioning and stickyness to let the sticky container only span the outer width of the scroll container, but that seems to be impossible so I went for a resize observer that pins the width of the sticky table header and table options through a css variable which turned out to work reasonably well.

refactor the table as css div table
prepare for column resizing #35

@datenangebot I don't remember exactly if the points in the old pr are still valid, but considering the refactor would still be valid, this seems like a good intermediate solution for browsing larger tables.

Kapture 2024-02-14 at 09 50 43
Kapture 2024-02-14 at 09 36 58

Also fixes #474

ToDo

  • Smart picker content widget scrolling needs fixing

@juliusknorr juliusknorr added bug Something isn't working papercut Small issues that doesn't break the ux/ui 3. to review Waiting for reviews labels Jan 19, 2024
@juliusknorr juliusknorr added this to the v0.7.0 milestone Jan 19, 2024
@juliusknorr juliusknorr added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jan 19, 2024
@datenangebot
Copy link
Collaborator

@datenangebot I don't remember exactly if the points in the old pr are still valid, but considering the refactor would still be valid, this seems like a good intermediate solution for browsing larger tables.

Looks good. I did not look to deep into the code. But would this also work if we have multiple tables on a page? (While adjusting the ncTable component, I am struggling with the stickiness in general. Or was that the trigger for this fix? 🙃)

@juliusknorr
Copy link
Member Author

juliusknorr commented Jan 22, 2024

No it was not directly related. I think this should also work with multiple tables on the same page where sticky headers from lower tables should stack on top of the upper header. Though would not exclude that we need some additional special handling for that (especially since the tables might have different width)

Copy link
Collaborator

@datenangebot datenangebot left a comment

Choose a reason for hiding this comment

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

Reasonable

@enjeck
Copy link
Contributor

enjeck commented Feb 12, 2024

Can we merge this? @juliushaertl

@juliusknorr
Copy link
Member Author

I still need to figure out how to do the scrolling with the link previews 🙈 Will try to get that done the next days

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorr
Copy link
Member Author

Ready from my side, maybe you can have another review @enjeck

Screen recordings added to the pull request description.

@juliusknorr juliusknorr added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 14, 2024
Copy link
Contributor

@enjeck enjeck left a comment

Choose a reason for hiding this comment

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

cool 😎

@juliusknorr juliusknorr merged commit 31307c9 into main Feb 15, 2024
41 checks passed
@juliusknorr juliusknorr deleted the bugfix/631 branch February 15, 2024 10:03
@enjeck enjeck mentioned this pull request Feb 16, 2024
@quentinDupont
Copy link

Awesome job, I was looking exactly at this issue, thanks for solving it !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working papercut Small issues that doesn't break the ux/ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Horizontal scrollbar missing if not scrolled down Verticaly
4 participants