0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

Merge pull request #1672 from logto-io/charles-log-3795-connector-cannot-be-dragged-upwards

fix(console): connector can be dragged upwards to reorder
This commit is contained in:
Charles Zhao 2022-07-25 21:41:35 +08:00 committed by GitHub
commit 0302723994
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,7 @@ const DraggableItem = ({ id, children, sortIndex, moveItem }: Props) => {
const clientOffset = monitor.getClientOffset(); const clientOffset = monitor.getClientOffset();
// Get pixels to the top // 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 // 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% // When dragging downwards, only move when the cursor is below 50%