From acaac0c1909ea0f2e98f23c9c0e77833e712dcc2 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 26 Jun 2024 14:48:30 +0100 Subject: [PATCH] Cap selected cell rows at 50 --- .../components/grid/controls/BulkDuplicationHandler.svelte | 2 +- packages/frontend-core/src/components/grid/stores/ui.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/frontend-core/src/components/grid/controls/BulkDuplicationHandler.svelte b/packages/frontend-core/src/components/grid/controls/BulkDuplicationHandler.svelte index c63b247794..a300843185 100644 --- a/packages/frontend-core/src/components/grid/controls/BulkDuplicationHandler.svelte +++ b/packages/frontend-core/src/components/grid/controls/BulkDuplicationHandler.svelte @@ -35,6 +35,7 @@ progressPercentage = progress * 100 } ) + await sleep(duration) // Select new cells to highlight them if (newRows.length) { @@ -46,7 +47,6 @@ const endCellId = getCellID(lastRow._id, lastCol.name) selectedCells.actions.selectRange(startCellId, endCellId) } - await sleep(duration) processing = false } diff --git a/packages/frontend-core/src/components/grid/stores/ui.js b/packages/frontend-core/src/components/grid/stores/ui.js index bdbfe82e83..7f39116b05 100644 --- a/packages/frontend-core/src/components/grid/stores/ui.js +++ b/packages/frontend-core/src/components/grid/stores/ui.js @@ -122,7 +122,10 @@ export const deriveStores = context => { return [] } const lowerRowIndex = Math.min(sourceRowIndex, targetRowIndex) - const upperRowIndex = Math.max(sourceRowIndex, targetRowIndex) + let upperRowIndex = Math.max(sourceRowIndex, targetRowIndex) + + // Cap rows at 50 + upperRowIndex = Math.min(upperRowIndex, lowerRowIndex + 49) // Column indices const sourceColIndex = $columnLookupMap[sourceInfo.field].__idx