mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-18 21:38:14 +00:00
Revert "refactor: canDropIn 逻辑换到 handleAccept"
This reverts commit 6e177628636611b5a1b1b508dbad5abba2356e95.
This commit is contained in:
parent
5b6792fcb0
commit
af473913d4
@ -843,8 +843,12 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
|||||||
this.sensing = true;
|
this.sensing = true;
|
||||||
this.scroller.scrolling(e);
|
this.scroller.scrolling(e);
|
||||||
const dropContainer = this.getDropContainer(e);
|
const dropContainer = this.getDropContainer(e);
|
||||||
|
if (
|
||||||
if (!dropContainer) {
|
!dropContainer ||
|
||||||
|
// too dirty
|
||||||
|
(typeof dropContainer.container?.componentMeta?.prototype?.options?.canDropIn === 'function' &&
|
||||||
|
!dropContainer.container?.componentMeta?.prototype?.options?.canDropIn(e.dragObject.nodes[0]))
|
||||||
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1113,6 +1117,10 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
|||||||
*/
|
*/
|
||||||
handleAccept({ container, instance }: DropContainer, e: LocateEvent) {
|
handleAccept({ container, instance }: DropContainer, e: LocateEvent) {
|
||||||
const { dragObject } = e;
|
const { dragObject } = e;
|
||||||
|
if (isRootNode(container)) {
|
||||||
|
return this.document.checkDropTarget(container, dragObject as any);
|
||||||
|
}
|
||||||
|
|
||||||
const meta = (container as Node).componentMeta;
|
const meta = (container as Node).componentMeta;
|
||||||
|
|
||||||
// FIXME: get containerInstance for accept logic use
|
// FIXME: get containerInstance for accept logic use
|
||||||
@ -1121,15 +1129,6 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof meta.prototype?.options?.canDropIn === 'function' &&
|
|
||||||
!meta.prototype?.options?.canDropIn(dragObject.nodes[0])) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isRootNode(container)) {
|
|
||||||
return this.document.checkDropTarget(container, dragObject as any);
|
|
||||||
}
|
|
||||||
|
|
||||||
// first use accept
|
// first use accept
|
||||||
if (acceptable) {
|
if (acceptable) {
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user