Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/material-ui/src/NativeSelect/NativeSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export const styles = (theme) => ({
},
/* Styles applied to the select component `selectMenu` class. */
selectMenu: {
height: 'auto', // Resets for multpile select with chips
minHeight: '1.1876em', // Required for select\text-field height consistency
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
overflow: 'hidden',
Expand Down
34 changes: 34 additions & 0 deletions test/regressions/tests/Select/SelectChips.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react';
import MenuItem from '@material-ui/core/MenuItem';
import Select from '@material-ui/core/Select';
import Chip from '@material-ui/core/Chip';

const values = ['I', 'Do not', 'Overflow'];

export default function SelectChips() {
return (
<Select
multiple
value={values}
style={{ maxWidth: 100 }}
renderValue={(selected) => (
<div
style={{
display: 'flex',
flexWrap: 'wrap',
}}
>
{selected.map((value) => (
<Chip key={value} label={value} style={{ margin: 2 }} />
))}
</div>
)}
>
{values.map((value) => (
<MenuItem key={value} value={value}>
{value}
</MenuItem>
))}
</Select>
);
}