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

When passing Data prop to Grouped mode, the outermost indexs can disappear [BUG] #608

Closed
DeeBndx opened this issue Mar 11, 2022 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@DeeBndx
Copy link

DeeBndx commented Mar 11, 2022

Describe the bug
When using Grouped mode, and setting the "data" prop the two outermost items (first and last index) will not be rendered depending on configuration of the "itemContent" prop.

Reproduction
I've made an example at: https://codesandbox.io/s/laughing-platform-hkcote

To Reproduce
Steps to reproduce the behavior:

FIRST ITEM MISSING:

  1. Pass data to <GroupedVirtuoso data={listOfItems} />
  2. In itemContent use the data parameter to render items from the list eg .
    itemContent={(index, groupIndex, itemData) => { return ( <div style={{ padding: "16px 0" }}>{itemData.content}</div> ); }}
  3. The first item in the created list will not be shown.

LAST ITEM MISSING:

  1. Pass data to <GroupedVirtuoso data={listOfItems} ... />
  2. In itemContent use the index as selector for the list to loop eg.
    itemContent={(index) => { const currentItem = listOfItems[index]; return ( <div>{currentItem.content}</div> ); }}
  3. The first item in the created list will not be shown.

Expected behavior
When passing the "data" prop to the component, I expect to see all items in the given data set.

Screenshots
example

Desktop:

  • OS: Windows
  • Browser: Brave, Chrome, Firefox, Edge
@DeeBndx DeeBndx added the bug Something isn't working label Mar 11, 2022
@DeeBndx DeeBndx changed the title [BUG] When passing Data prop to Grouped mode, the outermost indexs can disappear [BUG] Mar 11, 2022
@petyosi
Copy link
Owner

petyosi commented Mar 11, 2022

Duplicate of #235

@petyosi petyosi marked this as a duplicate of #235 Mar 11, 2022
@petyosi petyosi closed this as completed Mar 11, 2022
@petyosi petyosi added the duplicate This issue or pull request already exists label Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants