diff --git a/src/components/dashboard/clickable_cell_store.ts b/src/components/dashboard/clickable_cell_store.ts index 8974f1e75a..a80cd82e28 100644 --- a/src/components/dashboard/clickable_cell_store.ts +++ b/src/components/dashboard/clickable_cell_store.ts @@ -65,23 +65,17 @@ export class ClickableCellsStore extends SpreadsheetStore { const cells: ClickableCell[] = []; const getters = this.getters; const sheetId = getters.getActiveSheetId(); - for (const col of getters.getSheetViewVisibleCols()) { - for (const row of getters.getSheetViewVisibleRows()) { - const position = { sheetId, col, row }; - if (!getters.isMainCellPosition(position)) { - continue; - } - const action = this.getClickableAction(position); - if (!action) { - continue; - } - const zone = getters.expandZone(sheetId, positionToZone(position)); - cells.push({ - coordinates: getters.getVisibleRect(zone), - position, - action, - }); + for (const position of this.getters.getVisibleCellPositions()) { + const action = this.getClickableAction(position); + if (!action) { + continue; } + const zone = getters.expandZone(sheetId, positionToZone(position)); + cells.push({ + coordinates: getters.getVisibleRect(zone), + position, + action, + }); } return cells; } diff --git a/src/components/side_panel/pivot/pivot_side_panel/pivot_side_panel_store.ts b/src/components/side_panel/pivot/pivot_side_panel/pivot_side_panel_store.ts index e335396544..8df61e9b3e 100644 --- a/src/components/side_panel/pivot/pivot_side_panel/pivot_side_panel_store.ts +++ b/src/components/side_panel/pivot/pivot_side_panel/pivot_side_panel_store.ts @@ -211,13 +211,10 @@ export class PivotSidePanelStore extends SpreadsheetStore { } private isDynamicPivotInViewport() { - const sheetId = this.getters.getActiveSheetId(); - for (const col of this.getters.getSheetViewVisibleCols()) { - for (const row of this.getters.getSheetViewVisibleRows()) { - const isDynamicPivot = this.getters.isSpillPivotFormula({ sheetId, col, row }); - if (isDynamicPivot) { - return true; - } + for (const position of this.getters.getVisibleCellPositions()) { + const isDynamicPivot = this.getters.isSpillPivotFormula(position); + if (isDynamicPivot) { + return true; } } return false;