Skip to content

Commit 53cba8f

Browse files
authored
Merge pull request #20 from 0duaht/prevent-duplicate-tags
Prevent tags from being duplicated by adding only unique tags to list
2 parents 1653701 + 16a5122 commit 53cba8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class TagInput extends Component {
188188

189189
if (results && results.length > 0) {
190190
this.setState({ text: '' });
191-
this.props.onChange(value.concat(results));
191+
this.props.onChange([...new Set([...value, ...results])]);
192192
}
193193
};
194194

0 commit comments

Comments
 (0)