Skip to content

Commit

Permalink
Merge pull request #84 from fobbyal/fix-undefined-selected-rows-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
fobbyal authored Jul 29, 2021
2 parents e643f8b + b1763ff commit 206650f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class Grid extends React.PureComponent {
}

setSelectedRect = rect => {
this.setState(rect)
this.setState(rect, this.selectionChanged)
}

componentDidMount() {
Expand Down Expand Up @@ -587,10 +587,10 @@ class Grid extends React.PureComponent {
const { view } = this.state

for (let r = y1; r <= y2; r++) {
selectedRows.push(view[r])
if (view[r] != null) selectedRows.push(view[r])
}
for (let c = x1; c <= x2; c++) {
selectedHeaders.push(headers[c])
if (headers[c] != null) selectedHeaders.push(headers[c])
}

onSelectionChange({ selectedRows, selectedHeaders })
Expand Down

0 comments on commit 206650f

Please sign in to comment.