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

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

Closed
fschindler opened this issue May 2, 2017 · 1 comment

Comments

@fschindler
Copy link

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

@bvaughn bvaughn closed this as completed in d88ad4c May 8, 2017
@bvaughn
Copy link
Owner

bvaughn commented May 8, 2017

Tricky issue!

Should be resolved in 9.7.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants