我无法单击搜索输入下拉列表。首先,我已经用谷歌搜索过,这是 select2 与 bootstrap3 或 bootstrap4 的常见问题,但是对于 bootstrap 5 来说有点不同(我尝试删除 bootstrap 4 上的 z-index 及其工作),我已经尝试过像 z 这样的解决方案-index $.fn.modal.Constructor.prototype.enforceFocus = function() {};、、、$('#mySelect2').select2({ dropdownParent: $('#myModal') });和一些 css 但仍然无法工作。
也许我错过了一些我不确定的东西,已经过去了 4 天,希望你们能帮助我。
这里 jsFiddle : jsfiddle