Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Solid – Virtualizing with a container using max-height doesn't show all items when total height is below max-height

Đang mở
#869 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Trước tiên, hãy mở bản tái hiện CodeSandbox được liên kết và kiểm tra hành vi của virtualizer khi năm mục được thay đổi kích thước thành 198px bên trong một container có max-height là 1000px. Theo dõi quá trình tích hợp Solid từ bản tái hiện đó và xác minh rằng cả năm mục đều được trả về và render khi tổng chiều cao của chúng nhỏ hơn max-height.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

I have a dynamically sized virtual list whose container scroll element has a max-height style. This way, the container should shrink to the full list of items without needing a scrollbar if all of the items can fit below the max-height value.

However, this breaks in Solid. When the total size of the list approaches the max-height or exceeds it, only some of the items are shown.

See this example, where I have 5 items with an initial estimated size of 28px. Then I dynamically update the item size to be 198px. This adds up to a total height of 990px;. In this image, the container has a max-height of 1000px. Despite having enough room to fit everything, only 2 virtual items are returned by the virtualizer:
Image

See reproduction here: https://codesandbox.io/p/devbox/competent-tristan-7467c3

Your minimal, reproducible example

https://codesandbox.io/p/devbox/competent-tristan-7467c3

Steps to reproduce
  1. go to https://codesandbox.io/p/devbox/competent-tristan-7467c3
  2. See that not all items are drawn
Expected behavior

If the max-height exceeds the total height needed to show all items, all items should be shown.

How often does this bug happen?

Every time

Screenshots or Videos

Image

Platform

OSX Chrome

tanstack-virtual version

3.10.8

TypeScript version

No response

Additional context

No response

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.1k
Fork
472
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TanStack/virtual

Tất cả issue của TanStack/virtual

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.