TinyMCE Editor Loses Input Field Focus in Popup Dialog

When I try to open the TinyMCE editor in the pop-up dialog box and click Insert Link, a pop-up window in the Insert Link dialog box will appear, but I cannot write the Insert Link text box.

As far as I know, the problem is related to opening a dialog in another dialog. Has anyone found a way around this?

+6
source share
2 answers

I found the answer :)

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

just paste the above code and the focus will automatically be displayed in the last TinyMCE dialog box.

+9
source

I have one more trick to solve this. thanks tyemmcee, see error: 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

+1
source

Source: https://habr.com/ru/post/957741/


All Articles