Add data-bs-focus attribute to caseSeriesModal and prevent Bootstrap from stealing focus from Select2 inputs
This commit is contained in:
@@ -323,7 +323,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="caseSeriesModal" aria-hidden="true">
|
||||
<div class="modal fade" id="caseSeriesModal" aria-hidden="true" data-bs-focus="false">
|
||||
<div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -774,6 +774,13 @@
|
||||
item.classList.toggle('selected', cb.checked);
|
||||
cb.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
});
|
||||
|
||||
// Prevent Bootstrap 5 from stealing focus from Select2 inputs inside modals
|
||||
document.addEventListener('focusin', function (e) {
|
||||
if (e.target && e.target.closest && (e.target.closest('.select2-container') || e.target.closest('.select2-search__field') || e.target.closest('.select2-dropdown'))) {
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
}, true);
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user