From bcafb53c0cc2e54ee1aadb2afcb7f7a0e5bab56d Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:58:55 -0400 Subject: [PATCH] HPCC-32389 ECL Watch v9 fix grid selection onFocus fixes an issue where the list pages would lose track of any selected items upon window blur and refocus Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- esp/src/src-react/components/controls/Grid.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esp/src/src-react/components/controls/Grid.tsx b/esp/src/src-react/components/controls/Grid.tsx index f3cdd7a67f1..7a445acac93 100644 --- a/esp/src/src-react/components/controls/Grid.tsx +++ b/esp/src/src-react/components/controls/Grid.tsx @@ -240,8 +240,9 @@ const FluentStoreGrid: React.FunctionComponent = ({ setTotal(total); }); storeQuery.then(items => { + const selectedIndices = selectionHandler.getSelectedIndices(); setItems(items); - setSelection(selectionHandler.getSelection()); + selectedIndices.forEach(index => selectionHandler.setIndexSelected(index, true, false)); }); }, [count, selectionHandler, start, store], [query, sorted]);