fix(client): fix variable component for preload label based on value (#2200)

This commit is contained in:
Junyi 2023-07-06 22:52:22 +07:00 committed by GitHub
parent 5a8f3d1ae3
commit ff9e96d38b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -232,7 +232,7 @@ export function Input(props) {
useEffect(() => { useEffect(() => {
const run = async () => { const run = async () => {
if (!variable || !options.length) { if (!variable || options.length <= 1) {
return; return;
} }
let prevOption: DefaultOptionType = null; let prevOption: DefaultOptionType = null;

View File

@ -45,9 +45,9 @@ const InternalField: React.FC = (props) => {
setFieldProps('title', uiSchema.title); setFieldProps('title', uiSchema.title);
setFieldProps('description', uiSchema.description); setFieldProps('description', uiSchema.description);
setFieldProps('initialValue', uiSchema.default); setFieldProps('initialValue', uiSchema.default);
if (!field.validator && uiSchema['x-validator']) { // if (!field.validator && uiSchema['x-validator']) {
field.validator = uiSchema['x-validator']; // field.validator = uiSchema['x-validator'];
} // }
if (fieldSchema['x-disabled'] === true) { if (fieldSchema['x-disabled'] === true) {
field.disabled = true; field.disabled = true;
} }