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 @@ -296,6 +296,9 @@ export const SelectInput = (props: SelectInputProps) => {
296296 ) ;
297297 }
298298
299+ const renderHelperText =
300+ helperText !== false || ( ( isTouched || isSubmitted ) && invalid ) ;
301+
299302 return (
300303 < >
301304 < StyledResettableTextField
@@ -318,11 +321,13 @@ export const SelectInput = (props: SelectInputProps) => {
318321 clearAlwaysVisible
319322 error = { ! ! fetchError || ( ( isTouched || isSubmitted ) && invalid ) }
320323 helperText = {
321- < InputHelperText
322- touched = { isTouched || isSubmitted || fetchError }
323- error = { error ?. message || fetchError ?. message }
324- helperText = { helperText }
325- />
324+ renderHelperText ? (
325+ < InputHelperText
326+ touched = { isTouched || isSubmitted || fetchError }
327+ error = { error ?. message || fetchError ?. message }
328+ helperText = { helperText }
329+ />
330+ ) : null
326331 }
327332 margin = { margin }
328333 { ...sanitizeRestProps ( rest ) }
You can’t perform that action at this time.
0 commit comments