Bugfix: List with basic string should call onChange
This commit is contained in:
parent
63ae669507
commit
7b755d5839
@ -60,14 +60,17 @@ export default class ListControl extends Component {
|
||||
}
|
||||
|
||||
handleChange = (e) => {
|
||||
const { onChange } = this.props;
|
||||
const oldValue = this.state.value;
|
||||
const newValue = e.target.value;
|
||||
const listValue = e.target.value.split(',');
|
||||
if (newValue.match(/,$/) && oldValue.match(/, $/)) {
|
||||
listValue.pop();
|
||||
}
|
||||
|
||||
this.setState({ value: valueToString(listValue) });
|
||||
|
||||
const parsedValue = valueToString(listValue);
|
||||
this.setState({ value: parsedValue });
|
||||
onChange(listValue.map(val => val.trim()));
|
||||
};
|
||||
|
||||
handleCleanup = (e) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user