0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

fix(console): connector can be dragged upwards to reorder

This commit is contained in:
Charles Zhao 2022-07-25 21:28:34 +08:00
parent 26d300c65c
commit 038bba45e1
No known key found for this signature in database
GPG key ID: 4858774754C92DF2

View file

@ -52,7 +52,7 @@ const DraggableItem = ({ id, children, sortIndex, moveItem }: Props) => {
const clientOffset = monitor.getClientOffset();
// Get pixels to the top
const hoverClientY = clientOffset?.y ?? 0 - hoverBoundingRect.top;
const hoverClientY = (clientOffset?.y ?? 0) - hoverBoundingRect.top;
// Only perform the move when the mouse has crossed half of the items height
// When dragging downwards, only move when the cursor is below 50%