Skip to content

Commit

Permalink
fix(draggable-modal): can not visible when content too long
Browse files Browse the repository at this point in the history
fix #158
  • Loading branch information
buqiyuan committed Mar 9, 2024
1 parent 58d99f7 commit b427294
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/core/draggable-modal/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
iL >= maxL && (iL = maxL);
iT >= maxT && (iT = maxT);
dragEl.style.left = `${iL}px`;
dragEl.style.top = `${iT}px`;
dragEl.style.left = `${Math.max(iL, 0)}px`;
dragEl.style.top = `${Math.max(iT, 0)}px`;
};
const mouseup = () => {
document.removeEventListener('mousemove', mousemove);
Expand Down Expand Up @@ -190,6 +190,7 @@
left: iParentLeft,
right: iParentRight,
} = modalEl.getBoundingClientRect();
const disX = e.clientX - iParentLeft;
const disY = e.clientY - iParentTop;
const iParentWidth = modalEl.offsetWidth;
Expand Down Expand Up @@ -299,9 +300,10 @@
}
.ant-modal {
position: fixed;
position: relative;
min-width: 200px;
min-height: 200px;
margin: 0;
padding: 0;
.ant-modal-header {
Expand Down

0 comments on commit b427294

Please sign in to comment.