import React, { Fragment, PureComponent } from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import { Button, Typography, Dialog, DialogActions, DialogContent, DialogTitle, Input, InputLabel, MenuItem, FormControl, Select, Grid, } from '@material-ui/core'; const styles = theme => ({ demo: { height: 'auto', }, divider: { display: 'block', margin: `${theme.spacing(3)}px 0`, }, field: { margin: `${theme.spacing(3)}px 5px`, }, container: { display: 'flex', flexWrap: 'wrap', }, formControl: { margin: theme.spacing(1), minWidth: 120, }, button: { display: 'block', marginTop: theme.spacing(2), }, }); class ControlledSelectbox extends PureComponent { state = { open: false, openRemotely: false, age: '', }; handleChange = name => event => { this.setState({ [name]: Number(event.target.value) }); }; handleChangeControll = event => { this.setState({ [event.target.name]: event.target.value }); }; handleClickOpen = () => { this.setState({ open: true }); }; handleClickOpenRemot = () => { this.setState({ openRemotely: true }); }; handleClose = () => { this.setState({ open: false }); }; handleOpen = () => { this.setState({ open: true }); }; handleCloseRemot = () => { this.setState({ openRemotely: false }); }; handleOpenRemot = () => { this.setState({ openRemotely: true }); }; render() { const { classes } = this.props; return ( With a Dialog While its not encouraged by the Material Design specification, you can use a select inside a dialog.
Fill the form
Age Age
Controlled open Select
Age
); } } ControlledSelectbox.propTypes = { classes: PropTypes.object.isRequired, }; export default withStyles(styles)(ControlledSelectbox);