From 21b99cabcd5c8763bca13ee795251baf54d90b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Ostafin?= Date: Thu, 1 Aug 2024 13:57:25 +0200 Subject: [PATCH] IBX-8672: User can add several tags with the same tag name (#1310) --- dependencies.json | 17 +++++++++++++++++ .../src/modules/common/taggify/taggify.js | 6 ++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 dependencies.json diff --git a/dependencies.json b/dependencies.json new file mode 100644 index 0000000000..a47564afda --- /dev/null +++ b/dependencies.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/src/bundle/ui-dev/src/modules/common/taggify/taggify.js b/src/bundle/ui-dev/src/modules/common/taggify/taggify.js index a00a60cb44..61031d3584 100644 --- a/src/bundle/ui-dev/src/modules/common/taggify/taggify.js +++ b/src/bundle/ui-dev/src/modules/common/taggify/taggify.js @@ -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, }); });