bootstrap模态框和select2合用时input无法获取焦点
2016-08-21 23:01
441 查看
更多内容: http://blog.yuhai.win
产生的原因:
解决办法:
其他的解决办法:
参考文献: http://blog.csdn.net/fireofjava/article/details/48414207 http://www.voidcn.com/blog/ynwso/article/p-296035.html
当bootstrap 模态框和select2配合使用的时候或出现 input 无法获取焦点的问题
产生的原因:
Bootstrap registers a listener to the focusin event which checks whether the focused element is either the overlay itself or a descendent of it - if not it just refocuses on the overlay. With the select2 dropdown being attached to the body this effectively prevents you from entering anything into the the textfield. You can quickfix this by overwriting the enforceFocus function which registers the event on the modal
解决办法:
我这次解决的办法就是把tabindex="-1"去掉就可以了
其他的解决办法:
<script> $(document).ready(function() { $("#select2insidemodal").select2({ dropdownParent: "#myModal" }); }); </script>
相关文章推荐
- BootStrap模态框和select2合用时input无法获取焦点的解决方法
- bootstrap模态框和select2合用时input无法获取焦点
- bootstrap模态框modal和select2合用时input无法获取焦点
- 火狐下input焦点无法重复获取问题的解决方法
- 五八、移动端input、textarea无法获取焦点
- 解决动态添加input无法获取焦点事件
- input autofocus focus() 在iphone上无效,无法在手机上默认获取焦点
- bootstrap-modal:弹出modal时input的checked的状态无法改变 | | input获取焦点不生效
- 移动端input 无法获取焦点的问题
- 火狐下input焦点无法重复获取问题的解决方法
- DataGrid的TextInput无法获取焦点问题
- select2和bootstrap模态框一起使用导致select2的input获取不到焦点问题
- 关于使用input type=file 标签上传文件的注意细节(上传文件 无法获取文件 问题)
- bootstrap模态框input不能获取焦点并编辑【转】
- 记录:MUI框架中如何在多个input输入框失去焦点时获取当前input的value值
- input文本框获取焦点和失去焦点判断
- scrollview 中嵌套 edittext edit无法获取焦点的解决办法
- 记录EditText获取焦点后无法编辑 的解决方案
- 深究AngularJS——如何获取input的焦点(自定义指令)
- jQuery实现input文本框内灰色提示文本效果 和 input标签获取焦点是文本框内提示信息清空