简体   繁体   English

无法使用Twitter Bootstrap专注于jQuery UI模态中的文本框

[英]Can't focus in textbox inside jQuery UI modal with twitter bootstrap

I can't focus the textbox in a pane which comes on clicking dropdown as shown in image: 我无法将文本框集中在单击下拉菜单的窗格中,如图所示: 在此处输入图片说明

Here is the code I am using: 这是我正在使用的代码:

          $("#dialog-modal").dialog({
          title: "Upload to: FolderNameGoesHere",
          width: 720,
          height: 450,
          dialogClass: "file-upload-modal",
          modal: true,
          buttons: {
              "Save": function () {
                  $(this).dialog("close");
              },
              "Cancel": function () {
                  $(this).dialog("close");
              }
          }
      });

      // Fix input element click problem
      $('.input-append').click(function (e) {
          //$(this).focus();
          e.stopPropagation();

      });​

Here is the live js fiddle http://jsfiddle.net/5nDUf/1/ 这是现场js小提琴http://jsfiddle.net/5nDUf/1/

Modal tries to steal everything away from you :) 莫代尔试图从你身上偷走一切:)

$('.input-append').click(function (e) {
    //$(this).focus();
    e.stopPropagation();

});​

should be 应该

// Fix input element click problem
$('.input-append').bind('click mouseup mousedown keypress keydown keyup', function (e) {
    e.stopPropagation();
});​

fiddle http://jsfiddle.net/jaMda/ 小提琴http://jsfiddle.net/jaMda/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM