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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Autocomplete][material-ui] Disabled is not working properly #36867

Closed
2 tasks done
yamildiego opened this issue Apr 13, 2023 · 10 comments 路 Fixed by #36892 or #38611
Closed
2 tasks done

[Autocomplete][material-ui] Disabled is not working properly #36867

yamildiego opened this issue Apr 13, 2023 · 10 comments 路 Fixed by #36892 or #38611
Assignees
Labels
bug 馃悰 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material

Comments

@yamildiego
Copy link

yamildiego commented Apr 13, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 馃暪

Link to live example:
https://codesandbox.io/s/jovial-bose-plcz66?file=/package.json

Screen.Recording.2023-08-14.at.19.45.41.mov

There are two bugs but its the same issue
Steps:
Issue one (Autocomplete multiple={true} disabled):

  1. Press the title of the movie.
  2. You will see the options but you should not becase is disabled

Issue two (Autocomplete multiple={false} disabled):

  1. This is more difficult to reproduce, make click around the arrow multiples times.
  2. Stop, and start again.
  3. Even when is disabled open the panel of options to choose one. It doesn't always happen, I don't know what the trigger is, I just click and sometimes it happens.

Current behavior 馃槸

The autocomplete open the panel of options when is disabled.

Expected behavior 馃

I expect that if the autocomplete is disabled just show me the value/values without show me others options

Context 馃敠

Its confused for my customers see options that they don't have and they should not see

Your environment 馃寧

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@yamildiego yamildiego added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 13, 2023
@zannager zannager added the component: autocomplete This is the name of the generic UI component, not the React module! label Apr 13, 2023
@michaldudak
Copy link
Member

I can confirm it's a bug.
I can reproduce the second case reliably - press the mouse button on the title, move the cursor above the arrow, then release the button.

@sai6855, would you like to take a look at it?

@michaldudak michaldudak added bug 馃悰 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 13, 2023
@sai6855
Copy link
Contributor

sai6855 commented Apr 13, 2023

@michaldudak yes I will check

@sai6855
Copy link
Contributor

sai6855 commented Apr 16, 2023

Opened PR

@chepicov
Copy link

chepicov commented May 2, 2023

@sai6855 is this already released? seems it's still reproducing on v5.12.2
https://stackblitz.com/edit/react-fyfngh?file=demo.tsx,index.html
or am I doing smth wrong?

@mj12albert
Copy link
Member

@chepicov It's not in v5.12.2, it will be in this week's release!

@mj12albert
Copy link
Member

Apologies we'll need to reopen this and find a different fix, for more context: #36892 (comment)

CC @sai6855 @oliviertassinari

@mj12albert
Copy link
Member

mj12albert commented Aug 25, 2023

I was able to simplify the repro: https://codesandbox.io/s/https-github-com-mui-material-ui-issues-36867-m25xds?file=/demo.tsx

IMG_8EDEEC6DD982-1

Case 1 - Click anywhere in the green area

Case 2 - Mouse over the blue or green area, press and hold the left mouse button, move the cursor to the red area, release LMB

@mj12albert mj12albert added the package: material-ui Specific to @mui/material label Aug 25, 2023
@mj12albert mj12albert changed the title [Autocomplete] Disabled is not working properly [Autocomplete][material-ui] Disabled is not working properly Aug 25, 2023
@dhrumit9
Copy link

@mj12albert
Any timeline on when the fix for this issue will be released? I see the PR is still in the draft.

@mj12albert
Copy link
Member

@dhrumit9 Hey I was just testing it a whole bunch because I could hardly believe how simple the fix may be 馃槄 just waiting for some reviews for the PR now

In the mean time, you can fork this sandbox and test the fix, or use try this version in your project locally to see if it works for you:

yarn add https://pkg.csb.dev/mui/material-ui/commit/617d8f2b/@mui/material

@mj12albert
Copy link
Member

This fix is released in 5.14.7

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! package: material-ui Specific to @mui/material
Projects
None yet
7 participants