How to fix issue: Select2 does not function properly when I use it inside a Bootstrap modal?

How to fix issue: Select2 does not function properly when I use it inside a Bootstrap modal?

Just find the parent ID of the modal node

<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
    ...
    <select id="mySelect2">
        ...
    </select>
    ...
</div>

...

<script>
    $('#mySelect2').select2({
        dropdownParent: $('#myModal')
    });
</script>

Article Details

Article ID:
63
Date added:
18.01.2022 04:36:12
Views:
75
Rating (Votes):
(0)

Related articles