From 456670dd15d3059331e03bae993ec96483d3c69f Mon Sep 17 00:00:00 2001 From: sboursen-scinote Date: Fri, 2 Jun 2023 10:39:56 +0200 Subject: [PATCH] Fix Activities type dropdowns [SCI-8498] Co-authored-by: Sboursen --- app/assets/javascripts/sitewide/dropdown_selector.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/sitewide/dropdown_selector.js b/app/assets/javascripts/sitewide/dropdown_selector.js index 60eab52cc..f9803c735 100644 --- a/app/assets/javascripts/sitewide/dropdown_selector.js +++ b/app/assets/javascripts/sitewide/dropdown_selector.js @@ -716,7 +716,9 @@ var dropdownSelector = (function() { } else { // Or delete specific one deleteValue(selector, container, tagLabel.data('ds-tag-id'), tagLabel.data('ds-tag-group')); - removeOptionFromSelector(selector, tagLabel.data('ds-tag-id')); + if (selector.data('config').tagClass) { + removeOptionFromSelector(selector, tagLabel.data('ds-tag-id')); + } } }, 350); } @@ -1010,7 +1012,9 @@ var dropdownSelector = (function() { currentData = getCurrentData($(selector).next()); currentData.push(value); setData($(selector), currentData, skip_event); - appendOptionToSelector(selector, value); + if (selector.data('config').tagClass) { + appendOptionToSelector(selector, value); + } return this; },