Skip to content

[BUG] GroupedVirtuoso: empty groups only #1349

@schroda

Description

@schroda

Describe the bug

When there are only empty groups, both computeItemKey and itemContent are being called unexpectedly

Example:

groupCounts: [0]

calls:
computeItemKey, 0, 1
itemContent: 0

Reproduction

https://codesandbox.io/p/sandbox/grouped-virtuoso-compute-item-key-out-of-bounds-fwg59s

To Reproduce

Steps to reproduce the behavior:

  1. Open codesandbox
  2. See console

Expected behavior

Both computeItemKey and itemContent to not get called with a none-existent index

Screenshots

/

Desktop (please complete the following information):

  • OS: Windows 11 Pro 23H2
  • Browser: Edge 144.0.3719.92 (Official Build) (64-Bit)

Additional context
/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions