diff --git a/packages/react/src/widgets/DroppableWidget/index.tsx b/packages/react/src/widgets/DroppableWidget/index.tsx index 4d3b1c03c..d978b8b17 100644 --- a/packages/react/src/widgets/DroppableWidget/index.tsx +++ b/packages/react/src/widgets/DroppableWidget/index.tsx @@ -12,20 +12,21 @@ import './styles.less' export interface IDroppableWidgetProps { node?: TreeNode actions?: INodeActionsWidgetActionProps[] + placeholder?: boolean height?: number style?: React.CSSProperties className?: string } export const DroppableWidget: React.FC = observer( - ({ node, actions, height, style, className, ...props }) => { + ({ node, actions, height, placeholder, style, className, ...props }) => { const currentNode = useTreeNode() const nodeId = useNodeIdProps(node) const target = node ?? currentNode const hasChildren = target.children?.length > 0 return (
- {hasChildren ? ( + {hasChildren && !placeholder ? ( props.children ) : (
@@ -43,3 +44,7 @@ export const DroppableWidget: React.FC = observer( ) } ) + +DroppableWidget.defaultProps = { + placeholder: true, +}