user2972061
user2972061

Reputation: 355

TinyMCE editor lost the focus of input box on popup dialog

When I try to open the TinyMCE editor within a dialog box popup and click on "Insert link", the dialog box popup appears for "Insert link" but I am unable to write in the text field for "Insert link".

As far I know, the problem has to do with a dialog box open in another dialog box. Has anyone found a way around it?

Upvotes: 8

Views: 4231

Answers (2)

thomi_ch
thomi_ch

Reputation: 111

i got another trick to solve that.. thanks to tyemmcee, see bug: http://www.tinymce.com/develop/bugtracker_view.php?id=5917

  $.widget("ui.dialog", $.ui.dialog, {
    _allowInteraction: function(event) {
        return !!$(event.target).closest(".mce-container").length || this._super( event );
        }
    });

see tinymce fiddle: http://fiddle.tinymce.com/lpdaab/2

Upvotes: 1

user2972061
user2972061

Reputation: 355

I found the answer :)

$(document).on('focusin', function(e) {
    if ($(e.target).closest(".mce-window").length) {
        e.stopImmediatePropagation();
    }
});

just paste the above code and focus will bbe automatically on last dialog box of TinyMCE.

Upvotes: 10

Related Questions