diff --git a/packages/renderless/src/dialog-box/index.ts b/packages/renderless/src/dialog-box/index.ts index 8c6c62df06..940e07466f 100644 --- a/packages/renderless/src/dialog-box/index.ts +++ b/packages/renderless/src/dialog-box/index.ts @@ -295,8 +295,8 @@ export const handleDrag = let offsetWidth = modalBoxElem.offsetWidth let offsetHeight = modalBoxElem.offsetHeight - let maxX = visibleWidth - offsetWidth - let maxY = visibleHeight - offsetHeight + let maxX = Math.max(visibleWidth - offsetWidth, 0) + let maxY = Math.max(visibleHeight - offsetHeight, 0) let left = event.clientX - disX let top = event.clientY - disY