diff --git a/LEAF_Request_Portal/js/formSearch.js b/LEAF_Request_Portal/js/formSearch.js index 0972ca73e..0148541fa 100644 --- a/LEAF_Request_Portal/js/formSearch.js +++ b/LEAF_Request_Portal/js/formSearch.js @@ -958,12 +958,17 @@ var LeafFormSearch = function (containerID) { ""; } categories += ""; - $("#" + prefixID + "widgetMatch_" + widgetID).html( - categories - ); - chosenOptions(); - if (callback != undefined) { - callback(); + // quick and dirty fix to avoid a race condition related to custom + // implementations of formSearch. Since the new default UI will trigger + // the parent ajax call, we don't want to overwrite the existing widget + if($("#" + prefixID + "widgetMatch_" + widgetID).html() == "") { + $("#" + prefixID + "widgetMatch_" + widgetID).html( + categories + ); + chosenOptions(); + if (callback != undefined) { + callback(); + } } }, });