Jacek Pietal
Jacek Pietal

Reputation: 2019

How to fix Bootstrap 3 Modal + CKEditor 4.4 empty dialogs

I'm using

Twitter Bootstrap v3.0.2 and CKEditor v4.3.2

To reproduce the problem:

Create Modal with CKEditor in it, click on selects (select option like font family) multiple times

Result:

The dialogs with fonts and sizes etc become empty

I was looking to fix this since $('*').unbind() worked but I didn't want to loose other bound events

Upvotes: 1

Views: 749

Answers (1)

Jacek Pietal
Jacek Pietal

Reputation: 2019

I found out that $('.ui-widget').unbind() worked so I created a file called

bootstrap-ckeditor-fix.js loaded after bootstrap.js

And inside it I overrided the event called enforceFocus (which triggers on select click)

$.fn.modal.Constructor.prototype.enforceFocus = function() {
    $('.ui-widget').unbind();
};

V'oila!

Now the first click on select unbinds the events from only the main modal and it works!

Upvotes: 2

Related Questions