Skip to content

Commit

Permalink
Fixes #38237 - select2 search not working in modals
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga committed Feb 24, 2025
1 parent f9f1162 commit b6d2750
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,11 @@ function activate_select2(container, allowClear ) {
selectAllowClear = false;
}
}
var dropdownParent = $(document.body);
if ($(this).parents('.modal').length !== 0)
dropdownParent = $(this).parents('.modal');
$(this).select2({
dropdownParent,
language: langAttr,
width: '100%',
allowClear: selectAllowClear,
Expand Down

0 comments on commit b6d2750

Please sign in to comment.