New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Autocomplete] "A component is changing the controlled value state to be uncontrolled" error #22073
Comments
@p-himik This one is tough, it's an issue with the I don't know what would be the best solution in this case:
On a side note, this makes me think of facebook/react#17070, mentioning |
(2) seems very counter-intuitive. (1) was my immediate thought, because it just seems logical. And I don't know about the implications as well. But right now it seems that it's worth pursuing it simply because it's logical. (3) is in the same camp, I'd say it's just implementation details as long as they achieve the same goal and don't change the API.
Right, my bad - I've added the error message to the OP. |
@p-himik Cool, do you want to keep exploring the scope of the problem? :) |
To be honest, not really - I'm trying to do my best at avoiding going outside of ClojureScript. Especially when it comes to unfamiliar and complicated components with long history. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The problem is very close to #22170, we are discussing the solutions possible in https://github.com/mui-org/material-ui/issues/22170#issuecomment-691825640 |
Since https://github.com/mui-org/material-ui/issues/22170#issuecomment-691901855 we have a proposal that should, in theory, work. It's up for grab. |
The reproduction is now working correctly on the latest version (v5.0.0-alpha.12): https://codesandbox.io/s/material-demo-forked-t5j4w?file=/demo.js. I don't know when the issue was solved. |
Current Behavior 馃槸
If the list of
Autocomplete
options is changed when some other than first value is highlighted, pressing Enter will result in the error in the title.Expected Behavior 馃
There should be no error - you should be able to select any option just fine.
Steps to Reproduce 馃暪
Autocomplete
input field that should read "abcf"After some debugging, it seems that the root cause is that the selected item index is not recomputed on
options
change.Take a look at this dependency list of the relevant effect: https://github.com/mui-org/material-ui/blob/9bd4277ecd660ebe2fd4cb08960f58e98ddb6d43/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.js#L457-L464
As you can see, it only cares about whether there are any options at all and not about the number of options.
Context 馃敠
I'm trying to implement a simple autocomplete that loads its options via network.
Your Environment 馃寧
The text was updated successfully, but these errors were encountered: