From 68cd1fbe8e2e3d79fb7168a5bf7eab6ac1892164 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 12 Apr 2023 10:13:40 +0100 Subject: [PATCH] Fix reorder overlay z-index issue --- .../components/sheet/overlays/ReorderOverlay.svelte | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/frontend-core/src/components/sheet/overlays/ReorderOverlay.svelte b/packages/frontend-core/src/components/sheet/overlays/ReorderOverlay.svelte index 33e7aa310d..bde8c34182 100644 --- a/packages/frontend-core/src/components/sheet/overlays/ReorderOverlay.svelte +++ b/packages/frontend-core/src/components/sheet/overlays/ReorderOverlay.svelte @@ -10,15 +10,18 @@ stickyColumn, rowHeight, renderedRows, + scrollLeft, } = getContext("sheet") $: targetColumn = $reorder.targetColumn - $: left = getLeft(targetColumn, $stickyColumn, $visibleColumns) + $: minLeft = gutterWidth + ($stickyColumn?.width || 0) + $: left = getLeft(targetColumn, $stickyColumn, $visibleColumns, $scrollLeft) $: height = $rowHeight * ($renderedRows.length + 1) $: style = `left:${left}px; height:${height}px;` + $: visible = $isReordering && left >= minLeft - const getLeft = (targetColumn, stickyColumn, visibleColumns) => { - let left = gutterWidth + (stickyColumn?.width || 0) + const getLeft = (targetColumn, stickyColumn, visibleColumns, scrollLeft) => { + let left = gutterWidth + (stickyColumn?.width || 0) - scrollLeft // If this is not the sticky column, add additional left space if (targetColumn !== stickyColumn?.name) { @@ -33,7 +36,7 @@ } -{#if $isReordering} +{#if visible}