Skip to content

Commit

Permalink
Merge pull request #2242 from department-of-veterans-affairs/avoid-ra…
Browse files Browse the repository at this point in the history
…ce-condition

LEAF-4157 - Resolve UX issue in formSearch.js
  • Loading branch information
Pelentan authored Nov 21, 2023
2 parents fc7574c + a094199 commit 9629415
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions LEAF_Request_Portal/js/formSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -958,12 +958,17 @@ var LeafFormSearch = function (containerID) {
"</option>";
}
categories += "</select>";
$("#" + 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();
}
}
},
});
Expand Down

0 comments on commit 9629415

Please sign in to comment.