Skip to content

VirtualScroller does not render the list when resized or when its visibility changes. #7354

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

Closed
erwanlfrt opened this issue Mar 2, 2025 · 0 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@erwanlfrt
Copy link
Contributor

erwanlfrt commented Mar 2, 2025

Describe the bug

When the VirtualScroller is resized or when its visibility changes (not directly, but due to one of its ancestors), the list of items is not rendered.

I believe this bug is caused by the absence of a resize observer on the element itself. From the source code, I noticed that there is an event listener for window resize but not for the element, which explains why nothing happens when the element is resized

Pull Request Link

#7353

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-i3wskqty

Environment

Vite v5.3.2

Vue version

3.4.31

PrimeVue version

4.3.1

Node version

21.6.1

Browser(s)

Chrome 133

Steps to reproduce the behavior

There are two virtual scrollers: one inside a container div with a v-show condition and another inside a container div with a conditional height.

After 2 seconds, the first container will appear, and the second container will be resized. The VirtualScroller inside the first container will remain empty, while in the second container, items will be partially rendered.

Expected behavior

On VirtualScroller visibility change and on resize, the list of items should be rendered.

@erwanlfrt erwanlfrt added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 2, 2025
@erwanlfrt erwanlfrt changed the title VirtualScroller does not render the list on resize and on visibility change VirtualScroller does not render the list when resized or when its visibility changes. Mar 2, 2025
@tugcekucukoglu tugcekucukoglu added this to the 4.4.0 milestone Mar 6, 2025
@github-project-automation github-project-automation bot moved this to Review in PrimeVue Mar 6, 2025
@tugcekucukoglu tugcekucukoglu added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Mar 6, 2025
@tugcekucukoglu tugcekucukoglu modified the milestones: 4.4.0, 4.3.3 Mar 18, 2025
@tugcekucukoglu tugcekucukoglu self-assigned this Mar 18, 2025
tugcekucukoglu added a commit that referenced this issue Mar 18, 2025
@github-project-automation github-project-automation bot moved this from Review to Done in PrimeVue Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
Status: Done
Development

No branches or pull requests

2 participants