diff --git a/packages/next/src/__builtins__/mapStatus.ts b/packages/next/src/__builtins__/mapStatus.ts index d88bb416146..0f170eeb2f1 100644 --- a/packages/next/src/__builtins__/mapStatus.ts +++ b/packages/next/src/__builtins__/mapStatus.ts @@ -3,13 +3,17 @@ import { GeneralField } from '@formily/core' export const mapStatus = (props: any, field: GeneralField) => { const takeStatus = () => { if (!field) return - if (field['loading'] || field?.['validating']) return 'loading' + if (field['loading'] || field['validating']) return 'loading' if (field['invalid']) return 'error' if (field['warnings']?.length) return 'warning' return field.decoratorProps?.feedbackStatus } + const takeState = (state: string) => { + if (state === 'validating' || state === 'pending') return 'loading' + return state + } return { ...props, - state: props.state || takeStatus(), + state: takeState(props.state) || takeStatus(), } }