mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +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.scroller.scrolling(e);
|
||||
const dropContainer = this.getDropContainer(e);
|
||||
|
||||
if (!dropContainer) {
|
||||
if (
|
||||
!dropContainer ||
|
||||
// too dirty
|
||||
(typeof dropContainer.container?.componentMeta?.prototype?.options?.canDropIn === 'function' &&
|
||||
!dropContainer.container?.componentMeta?.prototype?.options?.canDropIn(e.dragObject.nodes[0]))
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1113,6 +1117,10 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
*/
|
||||
handleAccept({ container, instance }: DropContainer, e: LocateEvent) {
|
||||
const { dragObject } = e;
|
||||
if (isRootNode(container)) {
|
||||
return this.document.checkDropTarget(container, dragObject as any);
|
||||
}
|
||||
|
||||
const meta = (container as Node).componentMeta;
|
||||
|
||||
// FIXME: get containerInstance for accept logic use
|
||||
@ -1121,15 +1129,6 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
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
|
||||
if (acceptable) {
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user