原因: select2的z-index值小于父容器的z-index值
解决方法:设置select2的dropdownParent参数后,select2会根据据父容器的z-index值自动调整select2的z-index值
官网:https://select2.org/dropdown
$("#org").select2({
language: 'zh-CN',
dropdownParent: $('#orgBoxModal')
});
$('#orgBoxModal')为下拉框所在模态框对应的jquery对象
dropdownParent绑定的对象最好是模态框的最外层,这样当模态框高度较小的时候,下拉框才不会被遮挡。