@ckeditor/ckeditor5-widget 43.1.0-alpha.5 → 43.1.0-alpha.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/widget.js +12 -3
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-widget",
|
3
|
-
"version": "43.1.0-alpha.
|
3
|
+
"version": "43.1.0-alpha.6",
|
4
4
|
"description": "Widget API for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -12,12 +12,12 @@
|
|
12
12
|
"type": "module",
|
13
13
|
"main": "src/index.js",
|
14
14
|
"dependencies": {
|
15
|
-
"@ckeditor/ckeditor5-core": "43.1.0-alpha.
|
16
|
-
"@ckeditor/ckeditor5-engine": "43.1.0-alpha.
|
17
|
-
"@ckeditor/ckeditor5-enter": "43.1.0-alpha.
|
18
|
-
"@ckeditor/ckeditor5-ui": "43.1.0-alpha.
|
19
|
-
"@ckeditor/ckeditor5-utils": "43.1.0-alpha.
|
20
|
-
"@ckeditor/ckeditor5-typing": "43.1.0-alpha.
|
15
|
+
"@ckeditor/ckeditor5-core": "43.1.0-alpha.6",
|
16
|
+
"@ckeditor/ckeditor5-engine": "43.1.0-alpha.6",
|
17
|
+
"@ckeditor/ckeditor5-enter": "43.1.0-alpha.6",
|
18
|
+
"@ckeditor/ckeditor5-ui": "43.1.0-alpha.6",
|
19
|
+
"@ckeditor/ckeditor5-utils": "43.1.0-alpha.6",
|
20
|
+
"@ckeditor/ckeditor5-typing": "43.1.0-alpha.6",
|
21
21
|
"lodash-es": "4.17.21"
|
22
22
|
},
|
23
23
|
"author": "CKSource (http://cksource.com/)",
|
package/src/widget.js
CHANGED
@@ -217,6 +217,10 @@ export default class Widget extends Plugin {
|
|
217
217
|
const view = editor.editing.view;
|
218
218
|
const viewDocument = view.document;
|
219
219
|
let element = domEventData.target;
|
220
|
+
// Some of DOM elements have no view element representation so it may be null.
|
221
|
+
if (!element) {
|
222
|
+
return;
|
223
|
+
}
|
220
224
|
// If triple click should select entire paragraph.
|
221
225
|
if (domEventData.domEvent.detail >= 3) {
|
222
226
|
if (this._selectBlockContent(element)) {
|
@@ -514,10 +518,15 @@ function findClosestEditableOrWidgetAncestor(element) {
|
|
514
518
|
*/
|
515
519
|
function getElementFromMouseEvent(view, domEventData) {
|
516
520
|
const domRange = getRangeFromMouseEvent(domEventData.domEvent);
|
517
|
-
|
518
|
-
|
521
|
+
let viewRange = null;
|
522
|
+
if (domRange) {
|
523
|
+
viewRange = view.domConverter.domRangeToView(domRange);
|
524
|
+
}
|
525
|
+
else {
|
526
|
+
// Fallback to create range in target element. It happens frequently on Safari browser.
|
527
|
+
// See more: https://github.com/ckeditor/ckeditor5/issues/16978
|
528
|
+
viewRange = view.createRange(view.createPositionAt(domEventData.target, 0));
|
519
529
|
}
|
520
|
-
const viewRange = view.domConverter.domRangeToView(domRange);
|
521
530
|
if (!viewRange) {
|
522
531
|
return null;
|
523
532
|
}
|