refactor: remove search box when adding block to page (#5577)

* refactor:  remove search box  when adding block to page

* fix: bug
This commit is contained in:
Katherine 2024-11-05 10:11:00 +08:00 committed by GitHub
parent d1ca04ddc7
commit 2f1a9100a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,9 +44,14 @@ export const SchemaInitializerItemGroup: FC<SchemaInitializerItemGroupProps> = (
/** /**
* @internal * @internal
*/ */
export const SchemaInitializerItemGroupInternal = () => { export const SchemaInitializerItemGroupInternal = () => {
const itemConfig: any = useSchemaInitializerItem<SchemaInitializerItemGroupProps>(); const itemConfig: any = useSchemaInitializerItem<SchemaInitializerItemGroupProps>();
const searchedChildren = useMenuSearch(itemConfig); const searchedChildren = useMenuSearch(itemConfig);
if (itemConfig.name !== 'displayFields') {
return <SchemaInitializerItemGroup {...itemConfig} />;
}
/* eslint-disable react/no-children-prop */ /* eslint-disable react/no-children-prop */
return <SchemaInitializerItemGroup {...itemConfig} children={searchedChildren} />; return <SchemaInitializerItemGroup {...itemConfig} children={searchedChildren} />;
}; };