From 878ebfb8c57bf07d541c5de5a507be76d634d454 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 28 Feb 2023 14:31:58 +0000 Subject: [PATCH] Fix issue reordering columns in firefox and increase performance --- .../src/components/sheet/NewRow.svelte | 4 +++- .../src/components/sheet/ResizeOverlay.svelte | 20 +++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/frontend-core/src/components/sheet/NewRow.svelte b/packages/frontend-core/src/components/sheet/NewRow.svelte index 09121d636b..78a990ff58 100644 --- a/packages/frontend-core/src/components/sheet/NewRow.svelte +++ b/packages/frontend-core/src/components/sheet/NewRow.svelte @@ -3,7 +3,7 @@ import { Icon } from "@budibase/bbui" import { getContext } from "svelte" - const { visibleColumns, cellHeight, rows, selectedCellId } = + const { visibleColumns, cellHeight, rows, selectedCellId, reorder } = getContext("spreadsheet") const addRow = async field => { @@ -24,6 +24,8 @@ on:click={() => addRow(column)} width={column.width} left={column.left} + reorderSource={$reorder.columnIdx === column.idx} + reorderTarget={$reorder.swapColumnIdx === column.idx} /> {/each} diff --git a/packages/frontend-core/src/components/sheet/ResizeOverlay.svelte b/packages/frontend-core/src/components/sheet/ResizeOverlay.svelte index 6ed31268e6..b099c25a07 100644 --- a/packages/frontend-core/src/components/sheet/ResizeOverlay.svelte +++ b/packages/frontend-core/src/components/sheet/ResizeOverlay.svelte @@ -1,7 +1,8 @@ {#each $visibleColumns as col} @@ -65,9 +75,7 @@ class="resize-slider" class:visible={columnIdx === col.idx} on:mousedown={e => startResizing(col.idx, e)} - style="--left:{col.left + - col.width - - (col.idx === 0 ? 0 : $scroll.left)}px;" + style={getStyle(col, scrollLeft, rowCount)} >
@@ -90,7 +98,7 @@ .resize-slider.visible { cursor: col-resize; opacity: 1; - height: calc(100% - var(--controls-height)); + height: min(var(--content-height), calc(100% - var(--controls-height))); } .resize-indicator { margin-left: -1px;