);
}
private addTags = (value: string) => {
const { onAdd, onChange, values } = this.props;
const newValues = this.getValues(value);
let shouldClearInput = Utils.safeInvoke(onAdd, newValues);
// avoid a potentially expensive computation if this prop is omitted
if (Utils.isFunction(onChange)) {
shouldClearInput = shouldClearInput || onChange([...values, ...newValues]);
}
// only explicit return false cancels text clearing
if (shouldClearInput !== false) {
this.setState({ inputValue: "" });
}
};
private maybeRenderTag = (tag: React.ReactNode, index: number) => {
if (!tag) {
return null;
}
const { large, tagProps } = this.props;
const props = Utils.isFunction(tagProps) ? tagProps(tag, index) : tagProps;
return (