[AutoComplete] onChange not working in mui v5.2.7
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
I direct copy the whole code from the web and run it it shows the onChange props not working (i put in the console.log) , when I key in the textfield nothing update.
Expected behavior 🤔
onChange will trigger when the textfield in AutoComplete text changed,
at least when i typing somehing on textfield, the onChange will print out something on the console.log
Steps to reproduce 🕹
Steps:
1.direct put into the App.js 2. 3. 4.
Context 🔦
autocomplete from mui v4 is nice, although is a bit messy and complicated for me.
but mui v5 look like still very buggy
Your environment 🌎
`npx @mui/envinfo`
Don't forget to mention which browser you used.
Google Chrome Version 96.0.4664.110 (Official Build) (64-bit)
Output from `npx @mui/envinfo` goes here.
System:
OS: Windows 10 10.0.19043
Binaries:
Node: 14.15.0 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 96.0.4664.110
Edge: Spartan (44.19041.1266.0), Chromium (97.0.1072.55)
npmPackages:
@emotion/react: ^11.6.0 => 11.6.0
@emotion/styled: ^11.6.0 => 11.6.0
@mui/base: 5.0.0-alpha.58
@mui/icons-material: ^5.2.0 => 5.2.5
@mui/lab: ^5.0.0-alpha.58 => 5.0.0-alpha.58
@mui/material: ^5.2.0 => 5.2.0
@mui/private-theming: 5.2.2
@mui/styled-engine: 5.2.0
@mui/styles: ^5.2.1 => 5.2.1
@mui/system: 5.2.2
@mui/types: 7.1.0
@mui/utils: 5.2.2
@types/react: 17.0.37
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
typescript: 4.5.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Material UI AutoComplete onChange not working in mui v5 ...
I have upgraded to material ui v5 but the onChange option in Autocomplete seems to be having errors. I can't figure out what's...
Read more >Autocomplete API - Material UI
Name Type Default
options * array
renderInput * func
autoComplete bool false
Read more >FreeSoloCreateOption Material Demo
FreeSoloCreateOption Material Demo https://github.com/mui-org/material-ui/blob/v5.2.7/docs/src/pages/components/autocomplete/FreeSoloCreateOption.tsx.
Read more >can't resolve '@material-ui/core/styles
the problem was solved according to the answer from @samokasha , the solution was using npm install @material-ui/core --save I used the same...
Read more >React Material UI Tutorial - 13 - Autocomplete - YouTube
Courses - https://learn.codevolution.dev/ Support - https://www.paypal.me/Codevolution Github - https://github.com/gopinav⚡️ Checkout ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
onChange
in the Autocomplete is invoked when the value inside theAutocomplete
changes, for example new value is selected. You are probably looking for theonInputChange
prop, in case if you want to track changes on theinput
field itself.I see this is somehow already closed, but +1 for me. I tried migrating from @material-ui/lab to @mui but onChange does not fire in the new version.