1
0
Fork 0
mirror of synced 2024-09-10 22:46:09 +12:00

Update hovered row on wheel

This commit is contained in:
Andrew Kingston 2023-03-01 20:14:50 +00:00
parent 15c07e13ac
commit 2c1a5ae0e8

View file

@ -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
}
</script>