mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.4k stars 1.87k forks source link

Table with sticky header is incompatible with `Table.ScrollContainer` #6960

Open nabby27 opened 4 hours ago

nabby27 commented 4 hours ago

Dependencies check up

What version of @mantine/* packages do you have in package.json?

7.13.2

What package has an issue?

@mantine/core

What framework do you use?

Vite

In which browsers you can reproduce the issue?

Chrome

Describe the bug

I've recently been making a comparison table of features for different pricing plans. With this case and to be responsive I wanted both the header and the first column to be sticky.

For that I put the parameters stickyHeader and stickyHeaderOffset={0} to the table and wrapped the table with the Table.ScrollContainer component as indicated in the documentation. But the combination of both makes the stickyHeader stop working.

If possible, include a link to a codesandbox with a minimal reproduction

https://stackblitz.com/edit/mantine-bug-table-sticky-header-with-scrollcontainer?file=src%2FTableDemo.tsx

Possible fix

I've been investigating and it seems that the sticky header doesn't get along well with having overflows above it. Ideally, this result could be achieved: https://codepen.io/chriscoyier/pen/yLVNErX

Self-service

nabby27 commented 4 hours ago

I have created a $100 bounty because I am very interested in seeing this solved.