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

ListBox: No item is displayed when virtualScrollerOptions is used #7574

Closed
asteea opened this issue Jan 7, 2025 · 4 comments · Fixed by #7577
Closed

ListBox: No item is displayed when virtualScrollerOptions is used #7574

asteea opened this issue Jan 7, 2025 · 4 comments · Fixed by #7577
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@asteea
Copy link

asteea commented Jan 7, 2025

Describe the bug

When virtualScrollerOptions is used in ListBox, no items are displayed in the list. This feature works in version 10.8.5 but fails in version 10.9.1.

In the reproducer, the first ListBox with virtualScrollerOptions shows no items, while the second ListBox without virtualScrollerOptions displays all items correctly.

You can refer to the sample on the official site, which currently demonstrates the same issue:
https://primereact.org/listbox/#virtualscroll

Reproducer

https://stackblitz.com/edit/suezqpkl?file=src%2FApp.jsx

System Information

System:
    OS: Windows 11 10.0.22621
  Binaries:
    Node: 22.12.0 - C:\nvm4w\nodejs\node.EXE
    npm: 11.0.0 - C:\nvm4w\nodejs\npm.CMD
  Browsers:
    Chrome: 122.0.6261.70
    Edge: Chromium (129.0.2792.52)
  npmPackages:
    primereact: ^10.9.1 => 10.9.1
    react: ^18.3.1 => 18.3.1

Steps to reproduce the behavior

Added ListBox with multiple options
When virtualScrollerOptions is added ( e.g. virtualScrollerOptions={{ itemSize: 38 }} ), all items disappear
When virtualScrollerOptions is removed, all items reappear

Expected behavior

Items should appear when using the virtualScrollerOptions

@asteea asteea added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 7, 2025
@melloware
Copy link
Member

I am looking through the commits between 10.8.5 and 10.9.1 and I don't see anything ListBox or VirtualScroller related fixed?

@melloware
Copy link
Member

OK I have confirmed with your StackBlitz its working in 10.8.5 and not in 10.9.1.

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 7, 2025
@melloware
Copy link
Member

Found it! This was the only fix that touched VirtualScroller: #7516

@melloware
Copy link
Member

Confirmed its not working on the showcase as well: https://primereact.org/listbox/#virtualscroll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants