diff --git a/packages/core/client/src/application/schema-settings/components/SchemaSettingsChildren.tsx b/packages/core/client/src/application/schema-settings/components/SchemaSettingsChildren.tsx index bbf4a5859..421ca637e 100644 --- a/packages/core/client/src/application/schema-settings/components/SchemaSettingsChildren.tsx +++ b/packages/core/client/src/application/schema-settings/components/SchemaSettingsChildren.tsx @@ -1,5 +1,6 @@ import React, { FC, memo, useEffect, useMemo, useRef } from 'react'; +import { useFieldComponentName } from '../../../common/useFieldComponentName'; import { useFindComponent } from '../../../schema-component'; import { SchemaSettingsActionModalItem, @@ -17,7 +18,6 @@ import { } from '../../../schema-settings/SchemaSettings'; import { SchemaSettingItemContext } from '../context'; import { SchemaSettingsItemType } from '../types'; -import { useFieldComponentName } from '../../../common/useFieldComponentName'; export interface SchemaSettingsChildrenProps { children: SchemaSettingsItemType[]; @@ -70,6 +70,15 @@ export const SchemaSettingsChildren: FC = (props) = const useChildrenDefault = () => undefined; const useComponentPropsDefault = () => undefined; const useVisibleDefault = () => true; + +const InternalComponent = ({ Component, componentProps, useComponentProps, children }) => { + const useComponentPropsRes = useComponentProps(); + return ( + + {children} + + ); +}; export const SchemaSettingsChild: FC = memo((props) => { const { useVisible = useVisibleDefault, @@ -82,7 +91,6 @@ export const SchemaSettingsChild: FC = memo((props) => { componentProps, } = props as any; const useChildrenRes = useChildren(); - const useComponentPropsRes = useComponentProps(); const findComponent = useFindComponent(); const componentChildren = useMemo(() => { const res = [...(useChildrenRes || []), ...(children || [])]; @@ -106,11 +114,11 @@ export const SchemaSettingsChild: FC = memo((props) => { return ( - + {Array.isArray(componentChildren) && componentChildren.length > 0 && ( {componentChildren} )} - + ); }); diff --git a/packages/core/client/src/schema-component/antd/association-field/SubTabs/InternalCollapse.tsx b/packages/core/client/src/schema-component/antd/association-field/SubTabs/InternalCollapse.tsx index 1b6a9e3fb..101cfd449 100644 --- a/packages/core/client/src/schema-component/antd/association-field/SubTabs/InternalCollapse.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/SubTabs/InternalCollapse.tsx @@ -195,7 +195,7 @@ export const InternalTabs = observer((props) => { if (fuzzysearch(filter, item?.label) || filterItem?.length) { return { ...item, - childrenItems: filterItem.length ? filterItem : item.childrenItems, + childrenItems: filterItem?.length ? filterItem : item.childrenItems, }; } })