Jquery ui Redactor-在“插入链接”对话框中的输入元素无法获得焦点

Jquery ui Redactor-在“插入链接”对话框中的输入元素无法获得焦点,jquery-ui,jquery-ui-dialog,redactor,redactor.js,Jquery Ui,Jquery Ui Dialog,Redactor,Redactor.js,我正在尝试做一些类似于现在正在做的事情 唯一的区别是我使用的jQueryUI对话框是模态的 我尝试在页面中编辑脚本,使jQueryUI对话框成为模态 $("#dialog-modal").dialog( { modal: true, // added this line to make dialog modal width: 600, height: 400, open: function(event, ui) { var textarea

我正在尝试做一些类似于现在正在做的事情

唯一的区别是我使用的jQueryUI对话框是模态的

我尝试在页面中编辑脚本,使jQueryUI对话框成为模态

$("#dialog-modal").dialog(
{
    modal: true, // added this line to make dialog modal
    width: 600,
    height: 400,
    open: function(event, ui)
    {
        var textarea = $('<textarea style="height: 276px;">');
        $(textarea).redactor({
            focus: true,
            maxHeight: 300,
            initCallback: function()
            {
                this.code.set('<p>Lorem...</p>');
            }
        });
    }
 });
然后我点击了插入链接按钮工具栏右侧的第三个按钮。这显示了另一个带有表单的jQueryUI模式对话框

我注意到我无法获得文本字段的焦点。我打不进任何东西

如果我不将第一个对话框设置为模态,那么代码可以正常工作

$("#dialog-modal").dialog(
{
    modal: true, // added this line to make dialog modal
    width: 600,
    height: 400,
    open: function(event, ui)
    {
        var textarea = $('<textarea style="height: 276px;">');
        $(textarea).redactor({
            focus: true,
            maxHeight: 300,
            initCallback: function()
            {
                this.code.set('<p>Lorem...</p>');
            }
        });
    }
 });

你知道如何避开这个问题吗?

我遇到了同样的问题。此行为是jQuery UI处理文档上的focusin.dialog事件,并使用选择器将焦点放回堆栈中最后一个jQuery UI对话框的结果。UI对话框:可见:最后一个。我在创建模式对话框后立即调用此代码解决了此问题:

setTimeout(function() {
    $(document).unbind("focusin.dialog");
}, 100);

我使用了setTimeout,因为jQueryUI也使用setTimeout绑定此事件。由于以下回答,我能够修复它:。我还尝试升级到jQuery UI 1.11.4,但这并不能解决问题。

我遇到了同样的问题。此行为是jQuery UI处理文档上的focusin.dialog事件,并使用选择器将焦点放回堆栈中最后一个jQuery UI对话框的结果。UI对话框:可见:最后一个。我在创建模式对话框后立即调用此代码解决了此问题:

setTimeout(function() {
    $(document).unbind("focusin.dialog");
}, 100);
我使用了setTimeout,因为jQueryUI也使用setTimeout绑定此事件。由于以下回答,我能够修复它:。我还尝试升级到jQueryUI1.11.4,但这并不能解决问题