mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.68k stars 32.22k forks source link

[Autocomplete] change in screen size doesn't change width of Options container (when it's open) #27670

Open gaurikolhe opened 3 years ago

gaurikolhe commented 3 years ago

I am using AutoComplete component on my iPad. When I click on options and rotate the screen (portrait mode to landscape mode on Chrome, Safari & Firefox) the options container width doesn't reset with Textfield width of Autocomplete.

Screenshot 2021-08-09 at 4 30 19 PM

Current Behavior 😯

I have added screen shot of how it looks when I rotate screen. The AutoComplete code is as below <Autocomplete label="Select My HomePage" id="homePage" clearOnBlur clearOnEscape required forcePopupIcon freeSolo fullWidth onChange={onHomePageChange} value={selectedHomePage} options={[ { id: 1, name: "Batch Assistant" }, { id: 2, name: "Load Report" }, { id: 3, name: "Truck Map" }, ]} />

Expected Behavior 🤔

It should resize option container width on rotate screen.

Steps to Reproduce 🕹

  1. Open Safari browser in developer mode
  2. Render above code using Autocomplete component using MUI.
  3. Rotate Screen (change screen size in developer mode)

Context 🔦

Your Environment 🌎

Material-UI - 4.11.4 React - 17.0.2 Typescript - 4.2.4

ahmetuysal commented 3 years ago

I am having the same issue. Are there any workarounds we could use until the problem is fixed?

yhaizler commented 2 years ago

@gaurikolhe @ahmetuysal Did you find a solution to this bug? I also encountered this, and I don't know how to handle it.

sonam-diwate-personal commented 11 months ago

any solution on this

ISp1rit commented 5 months ago

I solved it this way:

Workaround of this unresolved issue: https://github.com/mui/material-ui/issues/27670 When the window is resized this hook will trigger re-render of this component and popper width will be re-calculated