Hey there, I'm encountering an issue where maxLength is not working on the AutoComplete component when the input type is set to number. Any suggestions on how to resolve this?
export default function Select({
onChangeInput,
label,
name,
value,
options,
placeholder,
disabled,
error,
helpertext,
required,
shrink,
maxLength,
type
}) {
const _onChange = useCallback((e, v) => {
onChangeInput(v)
})
return (
<Autocomplete
freeSolo
fullWidth={true}
multiple={false}
margin={'noraml'}
readOnly={disabled}
name={name}
isOptionEqualToValue={useCallback((option, value) => option.label === value.label)}
value={value}
options={options}
placeholder={placeholder}
renderInput={useCallback(params => {
return <TextField {...params}
type={type}
label={label}
error={error}
required={required}
helperText={helpertext}
variant={'standard'}
inputProps={{ ...params.inputProps, maxLength: (maxLength && parseInt(maxLength)) || 99}}
InputLabelProps={{ shrink: shrink, style: { fontSize: 18 } }}
/>
})}
onInputChange={_onChange}
/>
)
}