Skip to content

Commit

Permalink
IBX-8672: User can add several tags with the same tag name
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Jul 30, 2024
1 parent 263c284 commit 227eb8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bundle/ui-dev/src/modules/common/taggify/taggify.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ const Taggify = forwardRef(({ hotKeys, allowDuplicates, onTagsChange, bottomHint
let nextId = newTags.at(-1)?.id ?? 0;

inputTags.forEach((inputTagContent) => {
if ((!allowDuplicates && isDuplicated(newTags, inputTagContent)) || !inputTagContent) {
const trimmedInputTagContent = inputTagContent.trim();

if ((!allowDuplicates && isDuplicated(newTags, trimmedInputTagContent)) || !trimmedInputTagContent) {
return;
}

nextId++;
newTags.push({
id: nextId,
content: inputTagContent,
content: trimmedInputTagContent,
});
});

Expand Down

0 comments on commit 227eb8e

Please sign in to comment.