MenuItems are not fullWidth if TextField is fullWidth
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
If a TextField is set to fullWidth
and used as a Select, the MenuItems should be as wide as the input (and Menu).
Current Behavior
The Menu is the same width as the TextField, but the MenuItems are not the correct size.
Steps to Reproduce (for bugs)
<TextField fullWidth select label="Days and Stuff">
<MenuItem value={0}>Today</MenuItem>
<MenuItem value={1}>24 Hours</MenuItem>
<MenuItem value={7}>7 Days</MenuItem>
<MenuItem value={15'}>15 Days</MenuItem>
<MenuItem value={30}>30 Days</MenuItem>
</TextField>
Context
This just looks wonky - its not critical but people think our app is broken. In the meantime, I’ve used the native prop to skirt around the issue.
Your Environment
Tech | Version |
---|---|
Material-UI | beta 33 |
React | 15.x |
browser | Chrome / FF |
etc |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
MenuItems are not fullWidth if TextField is fullWidth #10395
If a TextField is set to fullWidth and used as a Select, the MenuItems should be as wide as the input (and Menu)....
Read more >Material-UI set <Select> to be as wide as widest <MenuItem>?
Have you tried adding fullWidth property in the textfield component? try to specify a container of your desired width and the input will ......
Read more >TextField API - Material UI - MUI
Name Type Default
autoComplete string
autoFocus bool false
classes object
Read more >How To Create Full Width Buttons - W3Schools
Learn how to style block buttons (full-width) with CSS. ... To create a full-width button, add a width of 100% and make it...
Read more >How to make a full width page | Shogun Support Center
Firstly, you will want to drag a Container Element onto your page. From the right-hand menu of the editor, you will notice that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another alternative is to use an override on the List component, i.e:
This can be used as a workaround: