diff --git a/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte b/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte index 0e7900204f..2ad169e8dc 100644 --- a/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte +++ b/packages/frontend-core/src/components/sheet/SheetScrollWrapper.svelte @@ -9,6 +9,7 @@ columns, visibleRows, visibleColumns, + hoveredRowId, } = getContext("spreadsheet") export let scrollVertically = true @@ -78,6 +79,11 @@ ...state, top: newScrollTop, })) + + // Hover row under cursor + const y = e.clientY - $bounds.top + (newScrollTop % cellHeight) + const hoveredRow = $visibleRows[Math.floor(y / cellHeight)] + $hoveredRowId = hoveredRow?._id }