@ckeditor/ckeditor5-link 45.0.0-alpha.4 → 45.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-link",
3
- "version": "45.0.0-alpha.4",
3
+ "version": "45.0.0-alpha.6",
4
4
  "description": "Link feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,16 +13,16 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "@ckeditor/ckeditor5-clipboard": "45.0.0-alpha.4",
17
- "@ckeditor/ckeditor5-core": "45.0.0-alpha.4",
18
- "@ckeditor/ckeditor5-engine": "45.0.0-alpha.4",
19
- "@ckeditor/ckeditor5-icons": "45.0.0-alpha.4",
20
- "@ckeditor/ckeditor5-image": "45.0.0-alpha.4",
21
- "@ckeditor/ckeditor5-typing": "45.0.0-alpha.4",
22
- "@ckeditor/ckeditor5-ui": "45.0.0-alpha.4",
23
- "@ckeditor/ckeditor5-utils": "45.0.0-alpha.4",
24
- "@ckeditor/ckeditor5-widget": "45.0.0-alpha.4",
25
- "ckeditor5": "45.0.0-alpha.4",
16
+ "@ckeditor/ckeditor5-clipboard": "45.0.0-alpha.6",
17
+ "@ckeditor/ckeditor5-core": "45.0.0-alpha.6",
18
+ "@ckeditor/ckeditor5-engine": "45.0.0-alpha.6",
19
+ "@ckeditor/ckeditor5-icons": "45.0.0-alpha.6",
20
+ "@ckeditor/ckeditor5-image": "45.0.0-alpha.6",
21
+ "@ckeditor/ckeditor5-typing": "45.0.0-alpha.6",
22
+ "@ckeditor/ckeditor5-ui": "45.0.0-alpha.6",
23
+ "@ckeditor/ckeditor5-utils": "45.0.0-alpha.6",
24
+ "@ckeditor/ckeditor5-widget": "45.0.0-alpha.6",
25
+ "ckeditor5": "45.0.0-alpha.6",
26
26
  "es-toolkit": "1.32.0"
27
27
  },
28
28
  "author": "CKSource (http://cksource.com/)",
package/src/linkui.js CHANGED
@@ -561,7 +561,13 @@ export default class LinkUI extends Plugin {
561
561
  emitter: this.formView,
562
562
  activator: () => this._isUIInPanel,
563
563
  contextElements: () => [this._balloon.view.element],
564
- callback: () => this._hideUI()
564
+ callback: () => {
565
+ // Focusing on the editable during a click outside the balloon panel might
566
+ // cause the selection to move to the beginning of the editable, so we avoid
567
+ // focusing on it during this action.
568
+ // See: https://github.com/ckeditor/ckeditor5/issues/18253
569
+ this._hideUI(false);
570
+ }
565
571
  });
566
572
  }
567
573
  /**
@@ -690,7 +696,7 @@ export default class LinkUI extends Plugin {
690
696
  /**
691
697
  * Removes the {@link #formView} from the {@link #_balloon}.
692
698
  */
693
- _removeFormView() {
699
+ _removeFormView(updateFocus = true) {
694
700
  if (this._isFormInPanel) {
695
701
  // Blur the input element before removing it from DOM to prevent issues in some browsers.
696
702
  // See https://github.com/ckeditor/ckeditor5/issues/1501.
@@ -701,7 +707,9 @@ export default class LinkUI extends Plugin {
701
707
  this._balloon.remove(this.formView);
702
708
  // Because the form has an input which has focus, the focus must be brought back
703
709
  // to the editor. Otherwise, it would be lost.
704
- this.editor.editing.view.focus();
710
+ if (updateFocus) {
711
+ this.editor.editing.view.focus();
712
+ }
705
713
  this._hideFakeVisualSelection();
706
714
  }
707
715
  }
@@ -766,7 +774,7 @@ export default class LinkUI extends Plugin {
766
774
  // If the properties form view is visible, remove it because it can be on top of the stack.
767
775
  this._removePropertiesView();
768
776
  // Then remove the form view because it's beneath the properties form.
769
- this._removeFormView();
777
+ this._removeFormView(updateFocus);
770
778
  // Finally, remove the link toolbar view because it's last in the stack.
771
779
  if (this._isToolbarInPanel) {
772
780
  this._balloon.remove(this.toolbarView);