diff --git a/ui/widgets/nuxeo-selectivity.js b/ui/widgets/nuxeo-selectivity.js index 622113668..e64d2eb22 100644 --- a/ui/widgets/nuxeo-selectivity.js +++ b/ui/widgets/nuxeo-selectivity.js @@ -2435,7 +2435,11 @@ typedArrayTags[weakMapTag] = false; let resultsHtml = isFilteredResultNotEmpty ? this.renderItems(filteredResults) : ''; if (options.hasMore) { resultsHtml += this.selectivity.template('loadMore'); - } else if (value && Array.isArray(value) && value.includes(options.term)) { + } else if ( + value && + Array.isArray(value) && + value.includes(options && options.term ? options.term.toLowerCase() : null) + ) { resultsHtml = this.selectivity.template('tagExists'); } else if (!resultsHtml && !options.add) { resultsHtml = this.selectivity.template('noResults', { term: options.term }); diff --git a/ui/widgets/nuxeo-tag-suggestion.js b/ui/widgets/nuxeo-tag-suggestion.js index 63070d193..f3c4e8b1a 100644 --- a/ui/widgets/nuxeo-tag-suggestion.js +++ b/ui/widgets/nuxeo-tag-suggestion.js @@ -237,6 +237,7 @@ import { escapeHTML } from './nuxeo-selectivity.js'; } _newEntryFormatter(term) { + term = term ? term.toLowerCase() : null; return { id: term, displayLabel: term, newTag: true }; }