virtual icon indicating copy to clipboard operation
virtual copied to clipboard

Border of row is disappear when scroll down

Open nrc2539 opened this issue 2 years ago • 8 comments

Describe the bug

When I scroll down in table around 20 rows is looking fine, but after that border of row will be display wrong position and then it disappear.

Your minimal, reproducible example

Code sandbox

Steps to reproduce

I using table example from document and modify style of <table> with style={{ borderCollapse: "collapse" }} and style of <tr> in <tbody> by adding borderTop: "1px solid #ff0000"

Expected behavior

Border of each row should be visible and display correctly position

How often does this bug happen?

Every time

Screenshots or Videos

https://github.com/TanStack/virtual/assets/37901109/40926069-52ba-4eac-b246-2bd333523b39

Platform

OS: macOS Browser: Google chrome Version 119.0.6045.105

tanstack-virtual version

"3.0.0-beta.68"

TypeScript version

No response

Additional context

No response

Terms & Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

nrc2539 avatar Nov 06 '23 16:11 nrc2539

I change estimateSize in useVirtualizer from 34 to 35 and border seem to display correct position but it still disappear after row 57

nrc2539 avatar Nov 07 '23 05:11 nrc2539

UPDATE : from example at https://github.com/TanStack/virtual/issues/585#issuecomment-1716173260 can solve this problem

by adding calculated height <tr> before and after section that rendering virtual row

maybe translateY in table example cause problem in this case

nrc2539 avatar Nov 07 '23 08:11 nrc2539

This is interesting, looks like it's connected how borders are handled in table by browser.

piecyk avatar Nov 08 '23 10:11 piecyk

I ran into similar issue with the border-collapse: collapse and not sure what's causing it but seems that getBoundingBox returns wrong values somehow.

okonet avatar Dec 20 '23 10:12 okonet

Facing the same issue. Is there a better example with react-table where rows can have variable height?

ak274 avatar Jan 08 '24 10:01 ak274

@ak274 best is to change positioning strategy, checkout this comment https://github.com/TanStack/virtual/issues/640#issuecomment-1885029911 same as @nrc2539 was suggesting

piecyk avatar Jan 10 '24 15:01 piecyk

Had somewhat the same issue, we used a workaround with a box-shadow instead of a border.

THMKAE avatar Jan 19 '24 17:01 THMKAE