Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Autocomplete] onChange still fires when disabled when multiple is true #18915

Closed
2 tasks done
areisle opened this issue Dec 18, 2019 · 2 comments · Fixed by #19041
Closed
2 tasks done

[Autocomplete] onChange still fires when disabled when multiple is true #18915

areisle opened this issue Dec 18, 2019 · 2 comments · Fixed by #19041
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module!

Comments

@areisle
Copy link

areisle commented Dec 18, 2019

values are still clearable when autocomplete is disabled

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

when the Autocomplete is disabled, if multiple is true, the values can still be cleared. however if multiple is false they can't.

Expected Behavior 🤔

that values would not be clearable when Autocomplete is disabled

Steps to Reproduce 🕹

https://codesandbox.io/s/material-demo-j1xvb
Steps:

  1. click the x on the chip in the autocomplete

Context 🔦

trying to show a readonly version of a form

Your Environment 🌎

Tech Version
Material-UI/core v4.8.0
Material-UI/lab v4.0.0-alpha.36
React 16.9.0
Browser chrome 78
@cvanem
Copy link
Contributor

cvanem commented Dec 27, 2019

I believe your desired functionality can be achieved by manually passing disabled to the Chip via the Autocomplete ChipProps or renderTags properties.

Here is an example using ChipProps: https://codesandbox.io/s/material-demo-zlge6

That being said, I think that the Autocomplete component should automatically forward the disabled prop to the Chip. What does everyone else think? Here is the change required to accomplish this: cvanem@a8dd0e2

@oliviertassinari oliviertassinari added component: autocomplete This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work labels Dec 31, 2019
@areisle
Copy link
Author

areisle commented Dec 31, 2019

great, thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants