//
// SPDX-License-Identifier: AGPL-3.0
-import * as React from 'react';
-import { Input as MuiInput, Chip as MuiChip, Popper as MuiPopper, Paper as MuiPaper, FormControl, InputLabel, StyleRulesCallback, withStyles, RootRef, ListItemText, ListItem, List, FormHelperText } from '@material-ui/core';
+import React from 'react';
+import {
+ Input as MuiInput,
+ Chip as MuiChip,
+ Popper as MuiPopper,
+ Paper as MuiPaper,
+ FormControl, InputLabel, StyleRulesCallback, withStyles, RootRef, ListItemText, ListItem, List, FormHelperText
+} from '@material-ui/core';
import { PopperProps } from '@material-ui/core/Popper';
import { WithStyles } from '@material-ui/core/styles';
import { noop } from 'lodash';
label?: string;
value: string;
items: Item[];
+ disabled?: boolean;
suggestions?: Suggestion[];
error?: boolean;
helperText?: string;
renderInput() {
return <Input
+ disabled={this.props.disabled}
autoFocus={this.props.autofocus}
inputRef={this.inputRef}
value={this.props.value}
<Chip
label={this.renderChipValue(item)}
key={index}
- onDelete={() => onDelete ? onDelete(item, index) : undefined} />
+ onDelete={onDelete && !this.props.disabled ? (() => onDelete(item, index)) : undefined} />
);
}