Skip to content

Commit eaa6b78

Browse files
committed
add fetchError to renderHelperText condition
1 parent 40bd4a4 commit eaa6b78

5 files changed

Lines changed: 10 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,9 +536,9 @@ If you provided a React element for the optionText prop, you must also provide t
536536
const isOptionEqualToValue = (option, value) => {
537537
return String(getChoiceValue(option)) === String(getChoiceValue(value));
538538
};
539-
540539
const renderHelperText =
541-
helperText !== false || ((isTouched || isSubmitted) && invalid);
540+
helperText !== false ||
541+
((isTouched || isSubmitted || fetchError) && invalid);
542542

543543
return (
544544
<>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ export const CheckboxGroupInput: FunctionComponent<CheckboxGroupInputProps> = pr
200200
}
201201

202202
const renderHelperText =
203-
helperText !== false || ((isTouched || isSubmitted) && invalid);
203+
helperText !== false ||
204+
((isTouched || isSubmitted || fetchError) && invalid);
204205

205206
return (
206207
<StyledFormControl

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ export const RadioButtonGroupInput = (props: RadioButtonGroupInputProps) => {
160160
}
161161

162162
const renderHelperText =
163-
helperText !== false || ((isTouched || isSubmitted) && invalid);
163+
helperText !== false ||
164+
((isTouched || isSubmitted || fetchError) && invalid);
164165

165166
return (
166167
<StyledFormControl

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ export const SelectArrayInput = (props: SelectArrayInputProps) => {
275275
}
276276
: {};
277277
const renderHelperText =
278-
helperText !== false || ((isTouched || isSubmitted) && invalid);
278+
helperText !== false ||
279+
((isTouched || isSubmitted || fetchError) && invalid);
279280

280281
return (
281282
<>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ export const SelectInput = (props: SelectInputProps) => {
297297
}
298298

299299
const renderHelperText =
300-
helperText !== false || ((isTouched || isSubmitted) && invalid);
300+
helperText !== false ||
301+
((isTouched || isSubmitted || fetchError) && invalid);
301302

302303
return (
303304
<>

0 commit comments

Comments
 (0)