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

DataScroller increases the first index value even when there are no rows #1902

Closed
kiranjholla opened this issue Mar 25, 2021 · 0 comments
Closed
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@kiranjholla
Copy link

I'm submitting a ...

[x] bug report

Codesandbox Case (Bug Reports)
https://codesandbox.io/s/primereact-test-forked-jrtj2?file=/src/index.js

Current behavior
If the array assigned to the value prop is empty at first, and then gets filled after a few seconds, say after an API call returns, but with only a few records then the DataScroller component fails to render the records.

Expected behavior
DataScroller should render the records irrespective of whether those are provided as part of the initial render or at a later time. I shouldn't be forced to use the lazy feature of DataScroller.

Minimal reproduction of the problem with instructions

  • Load the initial value for the value prop as an empty array []
  • Using a useEffect hook or something similar, fill this array with values asynchronously

Please tell us about your environment:
Windows 10, npm, react-scripts

  • React version:
    17.0.1

  • PrimeReact version:
    6.0.2

  • Browser:
    all

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    ES6

@mertsincan mertsincan self-assigned this Jul 31, 2021
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Jul 31, 2021
@mertsincan mertsincan added this to the 7.0.0 milestone Jul 31, 2021
@mcandu mcandu modified the milestones: 7.0.0, 6.5.1 Aug 13, 2021
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

No branches or pull requests

3 participants