Update hovered row on wheel
This commit is contained in:
parent
15c07e13ac
commit
2c1a5ae0e8
1 changed files with 6 additions and 0 deletions
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue