diff --git a/arches/app/media/js/bindings/select2-query.js b/arches/app/media/js/bindings/select2-query.js index d6fa415928c..a95347715fb 100644 --- a/arches/app/media/js/bindings/select2-query.js +++ b/arches/app/media/js/bindings/select2-query.js @@ -65,7 +65,7 @@ define([ var newOption = new Option(data.text, data.id, false, false); // Append it to the select $(el).append(newOption); - } + } }); // maintain the current selection after adding new dropdown options $(el).val(currentSelection).trigger('change'); @@ -92,13 +92,13 @@ define([ $(document).ready(function() { $(el).selectWoo(select2Config); - + if (value) { value.extend({ rateLimit: 100 }); // initialize the dropdown with the value $(el).val(value()); - $(el).trigger('change.select2'); - + $(el).trigger('change.select2'); + // update the dropdown if something else changes the value const valueSubscription = value.subscribe(function(newVal) { //console.log(newVal); @@ -119,21 +119,18 @@ define([ },300); }); - + $(el).on("change", function(e) { let val = $(el).val(); - if (val === "") { - val = null; - } value(val); }); - + $(el).on("select2:opening", function() { if (select2Config.clickBubble) { $(el).parent().trigger('click'); } }); - + if (typeof select2Config.onSelect === 'function') { $(el).on("select2:selecting", function(e) { select2Config.onSelect(e.params.args.data); diff --git a/releases/8.0.0.md b/releases/8.0.0.md index 534dd729c22..a9b877d285c 100644 --- a/releases/8.0.0.md +++ b/releases/8.0.0.md @@ -28,6 +28,7 @@ Arches 8.0.0 Release Notes - Make number datatype node values searchable in the main search [#11619](https://github.com/archesproject/arches/issues/11619) - Prevent navigation to a new browser tab when clicking Manage link in index.htm [#11635](https://github.com/archesproject/arches/issues/11635) - Add support for tile sort order to the bulk data manager [#11638](https://github.com/archesproject/arches/pull/11638) +- Fix issue that produced an error when cycling between the dropdown options in Advanced search [#11442](https://github.com/archesproject/arches/issues/11442) ### Dependency changes ```