How to include placeholder in select component in Material UI@Next
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
Select field should show Placeholder text.
Current Behavior
Placeholder text should be visible when passed to Input
tag.
Your Environment
Tech | Version |
---|---|
Material-UI | v1.0.0-beta.42 |
React | 16.1.0 |
browser | Chrome( 65.0.3325.181) |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:21 (2 by maintainers)
Top Results From Across the Web
How to create a select component with placeholder in React
Suppose you want a select component with a placeholder that will not be ... import Select from '@material-ui/core/Select'; import grey from ...
Read more >javascript - <Select> Placeholder styling
Styling via a className on the MenuItem does not work because the default display of the selected menu item displays its children.
Read more >React Select component - Material UI
The first step is to style the InputBase component. Once it's styled, you can either use it directly as a text field or...
Read more >Select displayEmpty placeholder
Select displayEmpty placeholder. https://github.com/mui-org/material-ui/blob/master/docs/src/pages/components/selects/SimpleSelect.js.
Read more >How to set a Placeholder on a Select tag in React
To set a placeholder on a Select tag in React, set the first option element of the select tag to `disabled` and give...
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
@NayanSrivastav This concern has already been raised in #8875. As far as the discussion went, the conclusion was that the placeholder property for a select component doesn’t make sense. With the given information, it’s not something we plan on addressing. Instead, @sakulstra has raised some great alternatives: https://github.com/mui-org/material-ui/pull/8875#issuecomment-349771804
https://codesandbox.io/s/wqq7059oq8
you can use the following