Bootstrap3 模態框 select2搜索框無法輸入
用modal來show一個對話框 dialog.modal({ backdrop:true, keyboard:true, show:true }); 然后再modal中初始化select2 dialog.find("select").select2 ...
這時候select 的搜索框無法輸入,一般有兩方面的原因 .檢查下modal的div中是否有tabindex ,這個屬性 lt div class modal fade in id dialog new draft gt .js代碼中加入 .fn.modal.Constructor.prototype.enforceFocus function 滿足這兩個一般就沒問題了。 ...
2017-06-19 16:20 0 3357 推薦指數:
用modal來show一個對話框 dialog.modal({ backdrop:true, keyboard:true, show:true }); 然后再modal中初始化select2 dialog.find("select").select2 ...
去掉模態框的div中的 tabindex="-1" 這個屬性 ...
按照select2官網配置完后,搜索框彈出后無法輸入內容,究竟怎么回事,於是在其他頁面嘗試了select2,發現可以啊,為什么在這個地方不可以,終於找到了造成這個問題的不同之處:select2在模態對話框中會失效。找到了問題所在,但不知道如何解決:百度或者google,最終找到了解決方案: 重寫 ...
select2地址:https://select2.github.io/examples.html 1.引入select2相關文件包括css,js 2.在select 標簽內 class="js-example-basic-single" 3.<script> ...
...
...
...
...