Open seungwoohong opened 2 years ago
I apologize but I don't really understand what is the issue you are reporting. Here is a working example - https://codesandbox.io/s/countryselect-demo-material-ui-forked-n7v8ke?file=/demo.tsx
I apologize for the lack of my explanation
Example code
<Autocomplete
renderInput={(params) => (
<TextField
{...params}
label="Choose a country"
InputProps={{
inputProps: {}
}} // I guess this code makes an error
inputProps={{
...params.inputProps,
autoComplete: "new-password"
}}
/>
)}
/>
After inserting InputProps into inputProps, clicking the input makes error as below
I apologize for the lack of my explanation
Example code
<Autocomplete renderInput={(params) => ( <TextField {...params} label="Choose a country" InputProps={{ inputProps: {} }} // I guess this code makes an error inputProps={{ ...params.inputProps, autoComplete: "new-password" }} /> )} />
After inserting InputProps into inputProps, clicking the input makes error as below
Why you add the line InputProps={{inputProps:{}}} ? Removing it seems work!
@nnguyen52 Thanks for your suggestion. but I think inputProps should be omitted in the type of the props to avoid the error in advance.
Duplicates
Latest version
Current behavior π―
An error 'Cannot read properties of null' has occurred on click autocomplete.
Codesandbox
Link
Is it a bug?
Expected behavior π€
In my opinion, It should be an error when assigning value in InputProps.inputProps.
Steps to reproduce πΉ
Steps:
1. 2. 3. 4.
Context π¦
No response
Your environment π
``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```npx @mui/envinfo