Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
4efef25d
Unverified
Commit
4efef25d
authored
Aug 06, 2022
by
lauriii
Browse files
Issue
#3301631
by nod_, Taran2L, xjm: Regression with CKEditor 35.0.1 and modal dialogs
parent
4b9c19c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/modules/ckeditor5/js/ckeditor5.dialog.fix.es6.js
View file @
4efef25d
...
...
@@ -7,23 +7,12 @@
*/
((
$
)
=>
{
// Get core version of the _focusTabbable method.
const
oldFocusTabbable
=
$
.
ui
.
dialog
.
_proto
.
_focusTabbable
;
$
.
widget
(
'
ui.dialog
'
,
$
.
ui
.
dialog
,
{
// Override core override of jQuery UI's `_
focusTabbable
()` so that
// Override core override of jQuery UI's `_
allowInteraction
()` so that
// CKEditor 5 in modals can work as expected.
_focusTabbable
()
{
// When the focused element is a CKEditor 5 instance, disable jQuery UI
// focus trap and delegate focus trap to CKEditor 5.
const
hasFocus
=
this
.
_focusedElement
?
this
.
_focusedElement
.
get
(
0
)
:
null
;
// In case the element is a CKEditor 5 instance, do not change focus
// management.
if
(
!
(
hasFocus
&&
hasFocus
.
ckeditorInstance
))
{
oldFocusTabbable
.
call
(
this
);
}
// @see https://api.jqueryui.com/dialog/#method-_allowInteraction
_allowInteraction
(
event
)
{
return
event
.
target
.
classList
.
contains
(
'
ck
'
)
||
this
.
_super
(
event
);
},
});
})(
jQuery
);
core/modules/ckeditor5/js/ckeditor5.dialog.fix.js
View file @
4efef25d
...
...
@@ -6,14 +6,9 @@
**/
(
$
=>
{
const
oldFocusTabbable
=
$
.
ui
.
dialog
.
_proto
.
_focusTabbable
;
$
.
widget
(
'
ui.dialog
'
,
$
.
ui
.
dialog
,
{
_focusTabbable
()
{
const
hasFocus
=
this
.
_focusedElement
?
this
.
_focusedElement
.
get
(
0
)
:
null
;
if
(
!
(
hasFocus
&&
hasFocus
.
ckeditorInstance
))
{
oldFocusTabbable
.
call
(
this
);
}
_allowInteraction
(
event
)
{
return
event
.
target
.
classList
.
contains
(
'
ck
'
)
||
this
.
_super
(
event
);
}
});
...
...
core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5DialogTest.php
View file @
4efef25d
...
...
@@ -71,10 +71,6 @@ function (ConstraintViolation $v) {
// Then press the button to add a link.
$this
->
pressEditorButton
(
'Link'
);
// @todo Un-skip this test when
// https://www.drupal.org/project/drupal/issues/3301631 is resolved.
$this
->
markTestSkipped
(
'Test skipped due to regression in CKEditor 35.0.0.'
);
$link_url
=
'/ckeditor5_test/dialog'
;
$input
=
$assert_session
->
waitForElementVisible
(
'css'
,
'.ck-balloon-panel input.ck-input-text'
);
// Make sure the input field can have focus and we can type into it.
...
...
lauriii
@lauriii
mentioned in commit
ae2382fc
·
Aug 05, 2022
mentioned in commit
ae2382fc
mentioned in commit ae2382fcb3df39f69b78e841fefc44e7f2f596a7
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment