Skip to content

Commit 30203ca

Browse files
committed
v1.19.8
1 parent 5436d8e commit 30203ca

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

components/Autocomplete/components.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Chip from '@material-ui/core/Chip';
22
import MenuItem from '@material-ui/core/MenuItem';
33
import Paper from '@material-ui/core/Paper';
4+
import withStyles from '@material-ui/core/styles/withStyles';
45
import TextField from '@material-ui/core/TextField';
56
import Typography from '@material-ui/core/Typography';
67
import CancelIcon from '@material-ui/icons/Cancel';
@@ -71,7 +72,10 @@ function Placeholder(props: any) {
7172

7273
function SingleValue(props: any) {
7374
return (
74-
<Typography className={props.selectProps.classes.singleValue} {...props.innerProps}>
75+
<Typography
76+
className={`${props.selectProps.classes.singleValue} ${props.classes.text}`}
77+
{...props.innerProps}
78+
>
7579
{props.children}
7680
</Typography>
7781
);
@@ -110,7 +114,14 @@ const components = {
110114
NoOptionsMessage,
111115
Option,
112116
Placeholder,
113-
SingleValue,
117+
SingleValue: withStyles({
118+
text: {
119+
maxWidth: 'calc(100% - 10px)',
120+
overflow: 'hidden',
121+
whiteSpace: 'nowrap',
122+
textOverflow: 'ellipsis'
123+
}
124+
})(SingleValue) as any,
114125
ValueContainer,
115126
};
116127

components/Autocomplete/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default class FieldAutocomplete extends FieldCoreBase<IProps, IState> {
8686
isDisabled={disabled}
8787
options={options}
8888
components={components}
89-
value={this.value}
89+
value={this.value || null}
9090
onFocus={this.onFocus}
9191
onBlur={this.onBlur}
9292
onChange={this.onChange}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"validation",
1111
"material"
1212
],
13-
"version": "1.19.7",
13+
"version": "1.19.8",
1414
"main": "./dist/index.js",
1515
"types": "./dist/index.d.ts",
1616
"license": "MIT",

0 commit comments

Comments
 (0)