Skip to content

Commit 21e88e6

Browse files
committed
display submitError in TextInput
1 parent 98d00c7 commit 21e88e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/ra-ui-materialui/src/input/TextInput.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const TextInput: FunctionComponent<TextInputProps> = ({
4242
id,
4343
input,
4444
isRequired,
45-
meta: { error, touched },
45+
meta: { error, submitError, touched },
4646
} = useInput({
4747
format,
4848
onBlur,
@@ -71,11 +71,11 @@ const TextInput: FunctionComponent<TextInputProps> = ({
7171
/>
7272
)
7373
}
74-
error={!!(touched && error)}
74+
error={!!(touched && (error || submitError))}
7575
helperText={
7676
<InputHelperText
7777
touched={touched}
78-
error={error}
78+
error={error || submitError}
7979
helperText={helperText}
8080
/>
8181
}

0 commit comments

Comments
 (0)