File tree Expand file tree Collapse file tree
packages/ra-ui-materialui/src/input Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,6 +274,8 @@ export const SelectArrayInput = (props: SelectArrayInputProps) => {
274274 ) ,
275275 }
276276 : { } ;
277+ const renderHelperText =
278+ helperText !== false || ( ( isTouched || isSubmitted ) && invalid ) ;
277279
278280 return (
279281 < >
@@ -337,13 +339,17 @@ export const SelectArrayInput = (props: SelectArrayInputProps) => {
337339 >
338340 { finalChoices . map ( renderMenuItem ) }
339341 </ Select >
340- < FormHelperText error = { fetchError || ( isTouched && ! ! error ) } >
341- < InputHelperText
342- touched = { isTouched || isSubmitted || fetchError }
343- error = { error ?. message || fetchError ?. message }
344- helperText = { helperText }
345- />
346- </ FormHelperText >
342+ { renderHelperText ? (
343+ < FormHelperText
344+ error = { fetchError || ( isTouched && ! ! error ) }
345+ >
346+ < InputHelperText
347+ touched = { isTouched || isSubmitted || fetchError }
348+ error = { error ?. message || fetchError ?. message }
349+ helperText = { helperText }
350+ />
351+ </ FormHelperText >
352+ ) : null }
347353 </ StyledFormControl >
348354 { createElement }
349355 </ >
You can’t perform that action at this time.
0 commit comments