Skip to content

Commit

Permalink
Re-added :key for Grid children but used a 0-based key instead of a r…
Browse files Browse the repository at this point in the history
…ows+column key.
  • Loading branch information
bvaughn committed Feb 22, 2016
1 parent f31a18c commit d644396
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/react-virtualized.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/react-virtualized.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion es/Grid/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ var Grid = (_temp = _class = function (_Component) {
rowStartIndex = overscanRowIndices.overscanStartIndex;
rowStopIndex = overscanRowIndices.overscanStopIndex;

var key = 0;

for (var rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
var rowDatum = this._rowMetadata[rowIndex];

Expand All @@ -388,7 +390,7 @@ var Grid = (_temp = _class = function (_Component) {
child = _react2.default.createElement(
'div',
{
key: 'row:' + rowIndex + ', column:' + columnIndex,
key: ++key,
className: 'Grid__cell',
style: {
transform: transform,
Expand Down
1 change: 1 addition & 0 deletions source/Grid/Grid.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export default class GridExample extends Component {
height={height}
noContentRenderer={this._noContentRenderer}
overscanColumnsCount={overscanColumnsCount}
overscanRowsCount={overscanRowsCount}
renderCell={this._renderCell}
rowHeight={useDynamicRowHeight ? this._getRowHeight : rowHeight}
rowsCount={rowsCount}
Expand Down
3 changes: 3 additions & 0 deletions source/Grid/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ export default class Grid extends Component {
rowStartIndex = overscanRowIndices.overscanStartIndex
rowStopIndex = overscanRowIndices.overscanStopIndex

let key = 0

for (let rowIndex = rowStartIndex; rowIndex <= rowStopIndex; rowIndex++) {
let rowDatum = this._rowMetadata[rowIndex]

Expand All @@ -435,6 +437,7 @@ export default class Grid extends Component {

child = (
<div
key={++key}
className='Grid__cell'
style={{
transform,
Expand Down

0 comments on commit d644396

Please sign in to comment.