Skip to content

Commit

Permalink
fix: fix modal dragging failure when destroyOnClose=true (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Oct 22, 2020
1 parent e0d9f2f commit 1ca738c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Modal/src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,20 @@ export default defineComponent({
};
};
};

const handleDrag = () => {
const dragWraps = document.querySelectorAll('.ant-modal-wrap');
for (const wrap of dragWraps as any) {
const display = getStyle(wrap, 'display');

const draggable = wrap.getAttribute('data-drag');
if (display !== 'none') {
// 拖拽位置
draggable === null && drag(wrap);
(draggable === null || props.destroyOnClose) && drag(wrap);
}
}
};

watchEffect(() => {
if (!props.visible) {
return;
Expand Down

0 comments on commit 1ca738c

Please sign in to comment.