diff --git a/packages/core/client/src/schema-component/antd/menu/Menu.tsx b/packages/core/client/src/schema-component/antd/menu/Menu.tsx index d24eb89ef..f0c46d3c5 100644 --- a/packages/core/client/src/schema-component/antd/menu/Menu.tsx +++ b/packages/core/client/src/schema-component/antd/menu/Menu.tsx @@ -363,7 +363,7 @@ Menu.Item = observer((props) => { eventKey={schema.name} schema={schema} > - + { window.open(props.href, '_blank'); }} > - + { key={schema.name} eventKey={schema.name} title={ - + {field.title} diff --git a/packages/core/client/src/schema-component/common/dnd-context/index.tsx b/packages/core/client/src/schema-component/common/dnd-context/index.tsx index 33aee7bfb..c17f15a70 100644 --- a/packages/core/client/src/schema-component/common/dnd-context/index.tsx +++ b/packages/core/client/src/schema-component/common/dnd-context/index.tsx @@ -19,6 +19,7 @@ const useDragEnd = (props?: any) => { const breakRemoveOn = over?.data?.current?.breakRemoveOn; const wrapSchema = over?.data?.current?.wrapSchema; const onSuccess = over?.data?.current?.onSuccess; + const removeParentsIfNoChildren = over.data.current.removeParentsIfNoChildren ?? true; if (!activeSchema || !overSchema) { props?.onDragEnd?.(event); @@ -49,7 +50,7 @@ const useDragEnd = (props?: any) => { dn.insertAdjacent(insertAdjacent, activeSchema, { wrap: wrapSchema, breakRemoveOn, - removeParentsIfNoChildren: true, + removeParentsIfNoChildren, onSuccess, }); props?.onDragEnd?.(event); diff --git a/packages/core/client/src/schema-component/common/sortable-item/SortableItem.tsx b/packages/core/client/src/schema-component/common/sortable-item/SortableItem.tsx index 1e8b3dec5..552583f22 100644 --- a/packages/core/client/src/schema-component/common/sortable-item/SortableItem.tsx +++ b/packages/core/client/src/schema-component/common/sortable-item/SortableItem.tsx @@ -57,8 +57,9 @@ const useSortableItemId = (props) => { export const SortableItem: React.FC = observer((props) => { const { schema, id, ...others } = useSortableItemProps(props); + const removeParentsIfNoChildren = others.removeParentsIfNoChildren ?? true; return ( - + {props.children} );