diff --git a/packages/client/src/schema-component/antd/icon-picker/IconPicker.tsx b/packages/client/src/schema-component/antd/icon-picker/IconPicker.tsx
index 9dce3bff0..8dcd882bd 100644
--- a/packages/client/src/schema-component/antd/icon-picker/IconPicker.tsx
+++ b/packages/client/src/schema-component/antd/icon-picker/IconPicker.tsx
@@ -1,4 +1,5 @@
import { CloseOutlined, LoadingOutlined } from '@ant-design/icons';
+import { useFormLayout } from '@formily/antd';
import { connect, mapProps, mapReadPretty } from '@formily/react';
import { isValid } from '@formily/shared';
import { Button, Input, Popover } from 'antd';
@@ -7,7 +8,8 @@ import { useTranslation } from 'react-i18next';
import { hasIcon, Icon, icons } from '../../../icon';
function IconField(props: any) {
- const { value, onChange } = props;
+ const layout = useFormLayout();
+ const { value, onChange, disabled } = props;
const [visible, setVisible] = useState(false);
const { t } = useTranslation();
return (
@@ -17,6 +19,9 @@ function IconField(props: any) {
placement={'bottom'}
visible={visible}
onVisibleChange={(val) => {
+ if (disabled) {
+ return;
+ }
setVisible(val);
}}
content={
@@ -37,10 +42,13 @@ function IconField(props: any) {
title={t('Icon')}
trigger="click"
>
-
+
- {value && (
+ {value && !disabled && (
}
onClick={(e) => {
onChange(null);