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

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

Open
arjendevos opened this issue Jun 3, 2024 · 3 comments
Open

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

arjendevos opened this issue Jun 3, 2024 · 3 comments
Labels
bug Something isn't working PR welcome You can give that a try :)

Comments

@arjendevos
Copy link

arjendevos commented Jun 3, 2024

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 arjendevos added the bug Something isn't working label Jun 3, 2024
@arjendevos
Copy link
Author

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

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

@arjendevos
Copy link
Author

Currently fixed it like this:

  • Added a tr with 1px height to the thead: <th className="bg-grey-100 h-px p-0" colSpan={4}></th>
  • Added a div inside the th to get the right border:
<th className="m-0 w-32 p-0 text-start font-medium text-slate-600">
  <div className="flex h-12 items-center border-r px-3">ID</div>
</th>

@petyosi
Copy link
Owner

petyosi commented Jun 4, 2024

@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.

@petyosi petyosi added the PR welcome You can give that a try :) label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR welcome You can give that a try :)
Projects
None yet
Development

No branches or pull requests

2 participants