forked from backdrop/backdrop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #6351: Fix jquery.ui focus conflict for CKEditor form elements.
By @indigoxela, @quicksketch, and @herbdool.
- Loading branch information
1 parent
404c61d
commit 298b285
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @file | ||
* Fix conflict with jquery.ui focusin event handling in dialogs. | ||
*/ | ||
(function ($) { | ||
|
||
'use strict'; | ||
|
||
/** | ||
* Override the _allowInteraction() extension point. | ||
* | ||
* @see https://api.jqueryui.com/dialog/#method-_allowInteraction | ||
* @see https://bugs.jqueryui.com/ticket/9087/ | ||
*/ | ||
$.widget('ui.dialog', $.ui.dialog, { | ||
_allowInteraction: function _allowInteraction(event) { | ||
// The CKEditor 5 balloon toolbar is outside the modal container, by | ||
// specifying CKEditor elements as allowed-interaction outside the modal, | ||
// the balloon buttons can be clicked. All editor form elements, like | ||
// buttons in balloon toolbars get the "ck" class. | ||
if ($(event.target).hasClass('ck')) { | ||
return true; | ||
} | ||
return this._super(event); | ||
} | ||
}); | ||
|
||
})(jQuery); |