diff --git a/client/src/ui/select.js b/client/src/ui/select.js index 51d6581864..57f851401e 100644 --- a/client/src/ui/select.js +++ b/client/src/ui/select.js @@ -93,6 +93,14 @@ define('ui/select', ['lib!Selectize'], (Selectize) => { return value; }); + let $relativeParent = null; + + let $modalBody = $el.closest('.modal-body'); + + if ($modalBody.length) { + $relativeParent = $modalBody; + } + let selectizeOptions = { sortField: [{field: options.sortBy, direction: options.sortDirection}], load: options.load, @@ -103,6 +111,7 @@ define('ui/select', ['lib!Selectize'], (Selectize) => { copyClassesToDropdown: false, allowEmptyOption: allowedValues.includes(''), showEmptyOptionInDropdown: true, + $relativeParent: $relativeParent, render: { item: function (data) { return $('