Oct 09, 2017 in Drupal 8, Snippets

I recently had an issue with ckeditor inside pop-ups (modals) in drupal 8. I could not edit the fields for entering column numbers and rows inside the table pop-up of my ckeditor. The snippet below fixes this issue. Source:

var orig_allowInteraction = $.ui.dialog.prototype._allowInteraction;
$.ui.dialog.prototype._allowInteraction = function(event) {
    // address interaction issues with general iframes with the dialog
    if (event.target.ownerDocument != this.document[0]) {
        return true;
    }
    // address interaction issues with dialog window
    if ($(event.target).closest(".cke_dialog").length) {
        return true;
    }
    // address interaction issues with iframe based drop downs in IE
    if ($(event.target).closest(".cke").length) {
        return true;
    }
    return orig_allowInteraction.apply(this, arguments);
}