Skip to content

Collapsed array range displays incorrect count when chunked #90

@nsaravanan27

Description

@nsaravanan27

Description:
When rendering a large array in react-json-view, the collapsed view shows incorrect index ranges if the array is split into chunks.

Steps to Reproduce:

  • Render an array with 200 elements using react-json-view.
  • Collapse the array so that values are shown in chunked ranges (e.g., 100 items per chunk).
  • Observe the displayed index ranges.

Actual Behavior:
The ranges are displayed as:
0 to 100 100 to 200

However, this is misleading:

  • 0 to 100 suggest 100 items, but index 100 does not exist.
  • 100 to 200 also suggests 100 items, but index 200 does not exist (last valid index is 199).

Expected Behavior:
Ranges should correctly display index bounds, for example:
0 to 99 100 to 199

Additional Context:
The mismatch can cause confusion when working with large datasets since the displayed ranges don’t match actual array indexes.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions