petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.03k stars 299 forks source link

[BUG] Border does not get respected with fixed headers #1097

Open arjendevos opened 1 month ago

arjendevos commented 1 month ago

Describe the bug You can actually see it in this: https://virtuoso.dev/table-fixed-headers/

When you scroll the border get's overlapped or dissappears.

My example:

Screenshot 2024-06-03 at 11 16 12

Midway scroll:

Screenshot 2024-06-03 at 11 19 48

Scrolling the border to the top:

Screenshot 2024-06-03 at 11 19 28

The border somehow scroll with the entire table but the fixed header stays. I've looked in the code but can't really pinpoint where this is happening.

arjendevos commented 1 month ago

Found the issue: position: sticky does somehow not respect the borders.

Found this codepen: https://codepen.io/Ray-H/pen/bMedLL

arjendevos commented 1 month ago

Currently fixed it like this:

petyosi commented 1 month ago

@arjendevos Thank you for sharing the workaround. If you think there's a way to fix this inside the component, please submit a PR. I'm not aware of a way to do that.