Skip to content

Commit

Permalink
IBX-8672: User can add several tags with the same tag name (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Aug 7, 2024
1 parent 1dcbfc9 commit 21b99ca
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
17 changes: 17 additions & 0 deletions dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"recipesEndpoint": "",
"packages": [
{
"requirement": "dev-IBX-8684-update-spinner as 4.6.x-dev",
"repositoryUrl": "https://github.com/ibexa/image-picker",
"package": "ibexa/image-picker",
"shouldBeAddedAsVCS": true
},
{
"requirement": "dev-IBX-8684-update-spinner as 4.6.x-dev",
"repositoryUrl": "https://github.com/ibexa/tree-builder",
"package": "ibexa/tree-builder",
"shouldBeAddedAsVCS": true
}
]
}
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 21b99ca

Please sign in to comment.