@ckeditor/ckeditor5-widget 43.1.0-alpha.1 → 43.1.0-alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/widget.js +14 -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.3",
|
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.3",
|
16
|
+
"@ckeditor/ckeditor5-engine": "43.1.0-alpha.3",
|
17
|
+
"@ckeditor/ckeditor5-enter": "43.1.0-alpha.3",
|
18
|
+
"@ckeditor/ckeditor5-ui": "43.1.0-alpha.3",
|
19
|
+
"@ckeditor/ckeditor5-utils": "43.1.0-alpha.3",
|
20
|
+
"@ckeditor/ckeditor5-typing": "43.1.0-alpha.3",
|
21
21
|
"lodash-es": "4.17.21"
|
22
22
|
},
|
23
23
|
"author": "CKSource (http://cksource.com/)",
|
package/src/widget.js
CHANGED
@@ -525,9 +525,20 @@ function getElementFromMouseEvent(view, domEventData) {
|
|
525
525
|
if (!viewPosition.parent) {
|
526
526
|
return null;
|
527
527
|
}
|
528
|
-
|
529
|
-
|
530
|
-
|
528
|
+
let viewNode = viewPosition.parent;
|
529
|
+
if (viewPosition.parent.is('editableElement')) {
|
530
|
+
if (viewPosition.isAtEnd && viewPosition.nodeBefore) {
|
531
|
+
// Click after a widget tend to return position at the end of the editable element
|
532
|
+
// so use the node before it if range is at the end of a parent.
|
533
|
+
viewNode = viewPosition.nodeBefore;
|
534
|
+
}
|
535
|
+
else if (viewPosition.isAtStart && viewPosition.nodeAfter) {
|
536
|
+
// Click before a widget tend to return position at the start of the editable element
|
537
|
+
// so use the node after it if range is at the start of a parent.
|
538
|
+
// See more: https://github.com/ckeditor/ckeditor5/issues/16992
|
539
|
+
viewNode = viewPosition.nodeAfter;
|
540
|
+
}
|
541
|
+
}
|
531
542
|
if (viewNode.is('$text')) {
|
532
543
|
return viewNode.parent;
|
533
544
|
}
|