Skip to content

Commit

Permalink
Merge pull request alibaba#2433 from loadchange/bugfix/20200308
Browse files Browse the repository at this point in the history
fix: new config add tag
  • Loading branch information
nkorange authored Mar 9, 2020
2 parents fe4946a + 59c19c4 commit 994da9c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ class NewConfig extends React.Component {
}
}

tagSearch(value) {
const { tagLst } = this.state;
if (!tagLst.includes(value)) {
this.setState({ tagLst: [value, ...tagLst] });
}
}

setConfigTags(value) {
if (value.length > 5) {
value.pop();
Expand All @@ -155,6 +162,7 @@ class NewConfig extends React.Component {
}
});
this.setState({
tagLst: value,
config_tags: value,
});
}
Expand Down Expand Up @@ -497,6 +505,7 @@ class NewConfig extends React.Component {
>
<Select
size={'medium'}
showSearch
hasArrow
style={{ width: '100%', height: '100%!important' }}
autoWidth
Expand All @@ -507,6 +516,7 @@ class NewConfig extends React.Component {
dataSource={this.state.tagLst}
value={this.state.config_tags}
onChange={this.setConfigTags.bind(this)}
onSearch={val => this.tagSearch(val)}
hasClear
/>
</FormItem>
Expand Down
Loading

0 comments on commit 994da9c

Please sign in to comment.