diff --git a/packages/frontend-core/src/components/sheet/HeaderRow.svelte b/packages/frontend-core/src/components/sheet/HeaderRow.svelte index 01a50d07f2..c5ff8e73f1 100644 --- a/packages/frontend-core/src/components/sheet/HeaderRow.svelte +++ b/packages/frontend-core/src/components/sheet/HeaderRow.svelte @@ -5,8 +5,7 @@ import { getIconForField } from "./utils" import SheetScrollWrapper from "./SheetScrollWrapper.svelte" - const { visibleColumns, reorder, selectedRows, rows } = - getContext("spreadsheet") + const { visibleColumns, reorder } = getContext("spreadsheet")
diff --git a/packages/frontend-core/src/components/sheet/NewRow.svelte b/packages/frontend-core/src/components/sheet/NewRow.svelte index 63985febf0..09173e68ed 100644 --- a/packages/frontend-core/src/components/sheet/NewRow.svelte +++ b/packages/frontend-core/src/components/sheet/NewRow.svelte @@ -1,11 +1,12 @@ -
+
($hoveredRowId = "new")}> {#each $visibleColumns as column} addRow(column)} width={column.width} left={column.left} @@ -30,8 +32,7 @@ .row { display: flex; } - :global(.sheet:not(.is-resizing):not(.is-reordering) .row:hover .cell) { - background: var(--cell-background-hover); + .row:hover :global(.cell) { cursor: pointer; } diff --git a/packages/frontend-core/src/components/sheet/Sheet.svelte b/packages/frontend-core/src/components/sheet/Sheet.svelte index 0065ba08ca..91f1c3f681 100644 --- a/packages/frontend-core/src/components/sheet/Sheet.svelte +++ b/packages/frontend-core/src/components/sheet/Sheet.svelte @@ -31,6 +31,7 @@ const tableIdStore = writable() const selectedCellId = writable() const selectedRows = writable({}) + const hoveredRowId = writable() const scroll = writable({ left: 0, top: 0, @@ -51,6 +52,7 @@ cellHeight, bounds, scroll, + hoveredRowId, tableId: tableIdStore, } const { rows, schema } = createRowsStore(context) @@ -114,7 +116,7 @@ display: flex; flex-direction: row; justify-items: flex-start; - align-items: stretch; + align-items: flex-start; overflow: hidden; height: 0; position: relative; @@ -124,5 +126,6 @@ overflow: hidden; display: flex; flex-direction: column; + align-self: stretch; } diff --git a/packages/frontend-core/src/components/sheet/SheetBody.svelte b/packages/frontend-core/src/components/sheet/SheetBody.svelte index 49c0ca3a16..841bb7bbd3 100644 --- a/packages/frontend-core/src/components/sheet/SheetBody.svelte +++ b/packages/frontend-core/src/components/sheet/SheetBody.svelte @@ -1,18 +1,11 @@ -
+
($hoveredRowId = row._id)}> {#each $visibleColumns as column (column.name)} {@const cellIdx = `${row._id}-${column.name}`} diff --git a/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte b/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte index 5018135334..f8c2340f4d 100644 --- a/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte +++ b/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte @@ -69,11 +69,11 @@ const offset = deltaY * step let newScrollTop = scrollTop newScrollTop += offset - newScrollTop = Math.max(0, newScrollTop) newScrollTop = Math.min( newScrollTop, ($rows.length + 1) * cellHeight - $bounds.height ) + newScrollTop = Math.max(0, newScrollTop) scroll.update(state => ({ ...state, top: newScrollTop, @@ -91,6 +91,8 @@