mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
fix: fixed-layout dragging adder materials check canDrop (#163)
This commit is contained in:
parent
61c7ad1a7a
commit
02a70f4b48
@ -41,12 +41,6 @@
|
|||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.port-if {
|
|
||||||
position: absolute;
|
|
||||||
right: 0px;
|
|
||||||
top: 36px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mouse-pad-option-icon {
|
.mouse-pad-option-icon {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@ -1,7 +1,22 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { FlowDragLayer, usePlayground } from '@flowgram.ai/fixed-layout-editor';
|
||||||
|
|
||||||
import { UIDragNodeContainer } from './styles';
|
import { UIDragNodeContainer } from './styles';
|
||||||
|
|
||||||
export default function DraggingAdder(): JSX.Element {
|
export default function DraggingAdder(props: any): JSX.Element {
|
||||||
|
const playground = usePlayground();
|
||||||
|
const layer = playground.getLayer(FlowDragLayer);
|
||||||
|
if (!layer) return <></>;
|
||||||
|
if (
|
||||||
|
layer.options.canDrop &&
|
||||||
|
!layer.options.canDrop({
|
||||||
|
dragNodes: layer.dragEntities || [],
|
||||||
|
dropNode: props.from,
|
||||||
|
isBranch: false,
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
return <></>;
|
||||||
|
}
|
||||||
return <UIDragNodeContainer />;
|
return <UIDragNodeContainer />;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user