Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
// bootstrap-ckeditor-modal-fix.js
// hack to fix ckeditor/bootstrap compatiability bug when ckeditor appears in a bootstrap modal dialog
// Include this AFTER both bootstrap and ckeditor are loaded.
// From:
// Author:
$.fn.modal.Constructor.prototype.enforceFocus = function() {
modal_this = this
$(document).on('focusin.modal', function (e) {
if (modal_this.$element[0] !== && !modal_this.$element.has(
&& !$('cke_dialog_ui_input_select')
&& !$('cke_dialog_ui_input_text')) {

It will work for bootstrap 2.3.2 ?
Thank you!

skilef commented Mar 29, 2015

Thank's !!!
Saved my day

AdnaneX commented Dec 17, 2015

sir how can i use for modal semantic ui

thank you so much!!!
Bootstrap v3.3.4 use: modal_this.$element.blur(), it works well in IE11

It not work with textarea as plugin code for ckeditor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment