Update hovered row on wheel
This commit is contained in:
parent
15c07e13ac
commit
2c1a5ae0e8
|
@ -9,6 +9,7 @@
|
||||||
columns,
|
columns,
|
||||||
visibleRows,
|
visibleRows,
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
|
hoveredRowId,
|
||||||
} = getContext("spreadsheet")
|
} = getContext("spreadsheet")
|
||||||
|
|
||||||
export let scrollVertically = true
|
export let scrollVertically = true
|
||||||
|
@ -78,6 +79,11 @@
|
||||||
...state,
|
...state,
|
||||||
top: newScrollTop,
|
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>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue