mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [dialog] drag into view when content is too high (#20595)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user