From f52383a5ed1fa99670972c6a1be1b6233d674717 Mon Sep 17 00:00:00 2001 From: pdudhat Date: Wed, 28 Jul 2021 03:35:45 -0400 Subject: [PATCH] fix(Grid): add data in selected rows if it exists in view --- src/Grid.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Grid.js b/src/Grid.js index d5ec51d..e73eac9 100644 --- a/src/Grid.js +++ b/src/Grid.js @@ -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 })