Skip to content

row-/column-index mismatch between Multigrid and Grid when using deferred measurement cache #670

@fschindler

Description

@fschindler

In CellMeasurer.DynamiWidthMultiGrid.example.js the outer Multigrid and the the four inner Grids are accessing the CellMeasurerCache using different indices.

CellMeasurer in CellMeasurer.DynamiWidthMultiGrid.example.js and _columnWidthRightGrid in the Multigrid are accessing the CellMeasurerCache using "global" indices (rowIndex + fixedRowCount and columnIndex + fixedColumnCount) e.g.:

_columnWidthRightGrid ({ index }) {
    const { columnCount, fixedColumnCount, columnWidth } = this.props

    ...

    return typeof columnWidth === 'function'
      ? columnWidth({ index: index + fixedColumnCount })
      : columnWidth
  }

In the four inner Grids of the Multigrid the defaultCellRangeRenderer is accessed by using "local" indices e.g.:

!deferredMeasurementCache.has(rowIndex, columnIndex)

Instead of checking rowIndex, columnIndex we should use:
in TopRightGrid rowIndex, columnIndex + fixedColumnCount
in BottomLeftGrid rowIndex + fixedRowCount, columnCount
in BottomRightGrid rowIndex + fixedRowCount, columnIndex + fixedColumnCount

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions