fix: input-tag max 属性bug修复

This commit is contained in:
liuzedong02 2022-07-21 14:30:32 +08:00
parent f97d246210
commit 7a47167388

View File

@ -253,6 +253,7 @@ export default class TagControl extends React.PureComponent<
: newValue;
}
@autobind
async addItem(option: Option) {
const {selectedOptions, onChange} = this.props;
const newValue = selectedOptions.concat();
@ -530,10 +531,10 @@ export default class TagControl extends React.PureComponent<
{options.map((item, index) => (
<div
className={cx('TagControl-sugItem', {
'is-disabled': item.disabled || disabled
'is-disabled': item.disabled || disabled || reachMax
})}
key={index}
onClick={this.addItem.bind(this, item)}
onClick={() => reachMax || this.addItem(item)}
>
{item.label}
</div>