mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-15 18:58:11 +00:00
fix: 修复磁贴点击页面容器假死问题 to #34464969
This commit is contained in:
parent
f8f5742d0a
commit
150d8f5fc5
@ -322,34 +322,33 @@ export class Dragon {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lastArrive = e;
|
lastArrive = e;
|
||||||
|
|
||||||
const locateEvent = createLocateEvent(e);
|
const locateEvent = createLocateEvent(e);
|
||||||
const sensor = chooseSensor(locateEvent);
|
const sensor = chooseSensor(locateEvent);
|
||||||
this._canDrop = !!sensor?.locate(locateEvent);
|
|
||||||
const { isRGL, rglNode } = getRGLObject(e);
|
const { isRGL, rglNode } = getRGLObject(e);
|
||||||
if (isRGL) {
|
if (isRGL) {
|
||||||
// 禁止原生响应
|
this._canDrop = !!sensor?.locate(locateEvent);
|
||||||
if (!isFromRGLNode && this._canDrop) {
|
if (this._canDrop) {
|
||||||
this.emitter.emit('rgl.add.placeholder', {
|
this.emitter.emit('rgl.add.placeholder', {
|
||||||
rglNode,
|
rglNode,
|
||||||
node: locateEvent.dragObject.nodes[0],
|
node: locateEvent.dragObject.nodes[0],
|
||||||
event: e,
|
event: e,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
designer.clearLocation();
|
designer.clearLocation();
|
||||||
this.clearState();
|
this.clearState();
|
||||||
this.emitter.emit('drag', locateEvent);
|
this.emitter.emit('drag', locateEvent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!isFromRGLNode && this._canDrop) {
|
this._canDrop = false;
|
||||||
this.emitter.emit('rgl.remove.placeholder');
|
this.emitter.emit('rgl.remove.placeholder');
|
||||||
}
|
}
|
||||||
if (sensor) {
|
if (sensor) {
|
||||||
|
sensor.locate(locateEvent);
|
||||||
sensor.fixEvent(locateEvent);
|
sensor.fixEvent(locateEvent);
|
||||||
} else {
|
} else {
|
||||||
designer.clearLocation();
|
designer.clearLocation();
|
||||||
}
|
}
|
||||||
this.emitter.emit('drag', locateEvent);
|
this.emitter.emit('drag', locateEvent);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const dragstart = () => {
|
const dragstart = () => {
|
||||||
@ -405,8 +404,10 @@ export class Dragon {
|
|||||||
// 发送drop事件
|
// 发送drop事件
|
||||||
if (e) {
|
if (e) {
|
||||||
const { isRGL, rglNode } = getRGLObject(e);
|
const { isRGL, rglNode } = getRGLObject(e);
|
||||||
if (isRGL && !isFromRGLNode && this._canDrop) {
|
if (isRGL && this._canDrop) {
|
||||||
const tarNode = dragObject.nodes[0];
|
const tarNode = dragObject.nodes[0];
|
||||||
|
if (rglNode.id !== tarNode.id) {
|
||||||
|
// 避免死循环
|
||||||
this.emitter.emit('rgl.drop', {
|
this.emitter.emit('rgl.drop', {
|
||||||
rglNode,
|
rglNode,
|
||||||
node: tarNode,
|
node: tarNode,
|
||||||
@ -415,6 +416,7 @@ export class Dragon {
|
|||||||
selection.select(tarNode.id);
|
selection.select(tarNode.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
if (e && isDragEvent(e)) {
|
if (e && isDragEvent(e)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user