From 36eb4dfb3341eb38c67ac77c5e85f53f4ae1db4b Mon Sep 17 00:00:00 2001 From: colemanw Date: Thu, 7 Sep 2023 10:07:19 -0400 Subject: [PATCH] APIv4 Explorer - Fix yml input values --- ang/api4Explorer/Explorer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ang/api4Explorer/Explorer.js b/ang/api4Explorer/Explorer.js index 48180a0f1d..12c922db26 100644 --- a/ang/api4Explorer/Explorer.js +++ b/ang/api4Explorer/Explorer.js @@ -1245,12 +1245,16 @@ if ($el.is('.crm-form-date-wrapper .crm-hidden-date')) { $el.crmDatepicker('destroy'); } - if ($el.is('.select2-container + input')) { + if (isSelect2()) { $el.crmAutocomplete('destroy'); } $(element).removeData().removeAttr('type').removeAttr('placeholder').show(); } + function isSelect2() { + return $(element).is('.select2-container + input'); + } + function makeWidget(field, op) { var $el = $(element), inputType = field.input_type, @@ -1312,7 +1316,7 @@ // If the viewValue is invalid (say required but empty) it will be `undefined` if (_.isUndefined(viewValue)) return; - if (!multi) { + if (!multi || !isSelect2()) { return viewValue; } -- 2.25.1