Sticky header in a useReactTable table with useVirtualizer disappears when scrolling
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend, performance
Hướng nghiên cứu
Bắt đầu với bản tái hiện tối thiểu được liên kết trong CodeSandbox và kiểm tra cách useReactTable, useVirtualizer, container có thể cuộn và wrapper chứa các phần tử được ảo hóa tương tác với nhau. Tái hiện việc thead biến mất khi cuộn trong Chrome, sau đó xác minh rằng header sticky vẫn hiển thị mà không khiến các hàng được ảo hóa bị mở rộng không chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
When using a react-table together with vritualizer and a sticky header the sticky header disappears when scrolling. This is due to the fact that when combining the two the table should be wrapped in two divs:
- The container that takes the height that should be taken up. This is the div that is scrollable
- The div that directly wraps the container and takes the height of all the virtual items combined
Since the table element at any given time only contains the visible rows (plus overscan) the table itself has a height smaller than the wrapper div (nr. 2). This causes the sticky header to disappear when you scroll down since the sticky header cannot escape the table element.
Your minimal, reproducible example
https://codesandbox.io/p/devbox/tanstack-react-virtual-example-dynamic-mr8t3x
Steps to reproduce
- Add
position: stickyto thetheadelement - Scroll down the table and watch how the header dissapears
Expected behavior
The header should stay on top since it is sticky.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Chrome
tanstack-virtual version
3.0.0-beta.68
TypeScript version
5.3.2
Additional context
I've tried getting rid of the wrapper div (nr. 2) and setting the height: ${getTotalSize()}px` directly on the table element but this causes the rows' height the grow because there are only ever enough rows to fit on the screen (plus overscan) but having the table the full height causes the rows to evenly divide the space between each other (making them a lot larger).
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- 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.
- Ngôn ngữ chính
- TypeScript
- Star
- 7.2k
- Fork
- 495
- Merge trung bình
- 23 giờ 16 phút
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/virtual
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
With `useScrollendEvent`, scrollToIndex and scrollToEnd stop short when the target moves while they settleCó thể đã có người làm @Darkatse đã nhận 11 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
svelte-virtual renders no rows when the scroll element is bound after the store subscribesCó thể đã có người làm @clean99 đã nhận 15 ngày trước. Đang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
anchorTo: 'end' does not keep the reading position when only paddingStart changesCó thể đã có người làm @duongynhi000001-crypto đã nhận 15 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 1 ngày
-
anchorTo: 'end' loses the end when the scroll element shrinksCó thể đã có người làm @langleyd đã nhận 44 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/virtual
Issue tương tự
-
inference/go type/feature
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
anomalyco/opencode#65148 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
truapi-release
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
paritytech/product-sdk#529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Mansudae TVĐang mởapproved check:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Perf] Canvas layer composition is quadratic: splitRenderLayers re-copies the node array per nodeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
devlikeapro/waha#2369 ·
Maintainer thường phản hồi trong vòng 5 ngày