The default z-index for a modal is not '1050' anymore, but '1055'. This means when using select2 inside a modal the dropdown will open under the modal.
z-index is currently specified in the main select2 css, not in this project. As this regards Bootstrap5 only, I think this modification should probably be made in this project.
Since a few months, and following these commits on the Bootstrap5 project:
The default z-index for a modal is not '1050' anymore, but '1055'. This means when using select2 inside a modal the dropdown will open under the modal.
z-index is currently specified in the main select2 css, not in this project. As this regards Bootstrap5 only, I think this modification should probably be made in this project.