diff --git a/packages/hooks/use-draggable/index.ts b/packages/hooks/use-draggable/index.ts index 0baa9fd7b4..a35d55e02a 100644 --- a/packages/hooks/use-draggable/index.ts +++ b/packages/hooks/use-draggable/index.ts @@ -28,7 +28,11 @@ export const useDraggable = ( const minLeft = -targetLeft + offsetX const minTop = -targetTop + offsetY const maxLeft = clientWidth - targetLeft - targetWidth + offsetX - const maxTop = clientHeight - targetTop - targetHeight + offsetY + const maxTop = + clientHeight - + targetTop - + (targetHeight < clientHeight ? targetHeight : 0) + + offsetY if (!overflow?.value) { moveX = Math.min(Math.max(moveX, minLeft), maxLeft)