-
Notifications
You must be signed in to change notification settings - Fork 6
Other: Don't set contenteditable property for widgets on Edge. #46
Conversation
@Mgsy This one might not work (although it should) before merging ckeditor/ckeditor5-engine#1450. You could check it now quickly but I'll ping you after ckeditor/ckeditor5-engine#1450 anyway :). |
src/utils.js
Outdated
// https://github.com/ckeditor/ckeditor5/issues/1079 | ||
if ( !env.isEdge ) { | ||
writer.setAttribute( 'contenteditable', 'false', element ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing blank line.
src/utils.js
Outdated
@@ -57,7 +58,11 @@ export function isWidget( element ) { | |||
* @returns {module:engine/view/element~Element} Returns same element. | |||
*/ | |||
export function toWidget( element, writer, options = {} ) { | |||
writer.setAttribute( 'contenteditable', 'false', element ); | |||
// The selection on Edge behaves better when whole editor contents is in single contentedible element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the whole
in a single contenteditable element
src/utils.js
Outdated
editable.on( 'change:isReadOnly', ( evt, property, is ) => { | ||
writer.setAttribute( 'contenteditable', is ? 'false' : 'true', editable ); | ||
} ); | ||
// Bind contenteditable property to element#isReadOnly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bind the contenteditable property
src/utils.js
Outdated
@@ -154,13 +159,17 @@ export function getLabel( element ) { | |||
export function toWidgetEditable( editable, writer ) { | |||
writer.addClass( [ 'ck-editor__editable', 'ck-editor__nested-editable' ], editable ); | |||
|
|||
// Set initial contenteditable value. | |||
writer.setAttribute( 'contenteditable', editable.isReadOnly ? 'false' : 'true', editable ); | |||
// The selection on Edge behaves better when whole editor contents is in single contentedible element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the whole
in a single contenteditable element
CC dropped. We need to cover this. You can stub |
Suggested merge commit message (convention)
Other: Don't set contenteditable property for widgets on Edge.
Additional information
env.isEdge
: Feature: Add env.isEdge property. ckeditor5-utils#248.