From 31f989764606a4e88e2978726d9f583d2dda9c1c Mon Sep 17 00:00:00 2001 From: rahuljain-dev Date: Tue, 15 Oct 2024 23:47:21 +0530 Subject: [PATCH] Review comments incorporated --- ui/widgets/nuxeo-selectivity.js | 2 +- ui/widgets/nuxeo-tag-suggestion.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/widgets/nuxeo-selectivity.js b/ui/widgets/nuxeo-selectivity.js index 766002958..c4d076260 100644 --- a/ui/widgets/nuxeo-selectivity.js +++ b/ui/widgets/nuxeo-selectivity.js @@ -2435,7 +2435,7 @@ 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.toLowerCase())) { + } else if (value && Array.isArray(value) && value.includes(options?.term?.toLowerCase())) { 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 adba42d92..5b1294fbb 100644 --- a/ui/widgets/nuxeo-tag-suggestion.js +++ b/ui/widgets/nuxeo-tag-suggestion.js @@ -237,7 +237,7 @@ import { escapeHTML } from './nuxeo-selectivity.js'; } _newEntryFormatter(term) { - term = term.toLowerCase(); + term = term?.toLowerCase(); return { id: term, displayLabel: term, newTag: true }; }