-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[material-ui][Autocomplete] Resizing on hover/focus when displayed in a table with table-layout: auto set #42340
Comments
Until there is a fix you can workaround with this: sx={{ "& :hover .MuiAutocomplete-input": { minWidth: "30px" } }} |
True, that works for hovering over the input box in this specific scenario, however if you hover over the dropdown element or if you select an item then the Autocomplete will start resizing again. |
Yeah that's annoying I think workaround is going to be awkward because of specificity. I'm also looking for a fix or workaround to this issue. This bug means you can't use autocomplete in flexbox without setting a width. |
Actually looking at the code my workaround is just missing the focused selector.
|
I'm still having the same issue resizeonhover.mp4Thanks for the workaround |
@mimccio Which version are you on? |
Steps to reproduce
Link to live example: https://codesandbox.io/p/sandbox/icy-voice-mh8ff2?file=%2Fsrc%2FDemo.tsx
Steps:
Current behavior
When hovering over the autocomplete field (or when focusing in on it) the autocomplete shrinks. If you position the mouse in the "right" position, the autocomplete will rapidly switch between the full size version and the shrunken version.
Expected behavior
The autocomplete field should not resize when hovering over it.
Context
My website allows users to enter data into "editable" tables, where the cells contain MUI fields that the user can enter data into:
Your environment
npx @mui/envinfo
I'm using Chrome Version 125.0.6422.60 (Official Build) (64-bit), but this also happens in Firefox 126.0 (64-bit),
My site is using @mui/material 5.15.3, but as demonstrated in the CodeSandbox recreation it is also happening in the latest version of MUI.
I think this is a result of this commit https://github.com/mui/material-ui/pull/41781/files. If I disable the following style on the element it stops resizing:
Search keywords: autocomplete
The text was updated successfully, but these errors were encountered: