@ckeditor/ckeditor5-emoji 45.0.0-alpha.7 → 45.0.0-alpha.8

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-emoji",
3
- "version": "45.0.0-alpha.7",
3
+ "version": "45.0.0-alpha.8",
4
4
  "description": "Emoji feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,13 +13,13 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "@ckeditor/ckeditor5-core": "45.0.0-alpha.7",
17
- "@ckeditor/ckeditor5-icons": "45.0.0-alpha.7",
18
- "@ckeditor/ckeditor5-mention": "45.0.0-alpha.7",
19
- "@ckeditor/ckeditor5-typing": "45.0.0-alpha.7",
20
- "@ckeditor/ckeditor5-ui": "45.0.0-alpha.7",
21
- "@ckeditor/ckeditor5-utils": "45.0.0-alpha.7",
22
- "ckeditor5": "45.0.0-alpha.7",
16
+ "@ckeditor/ckeditor5-core": "45.0.0-alpha.8",
17
+ "@ckeditor/ckeditor5-icons": "45.0.0-alpha.8",
18
+ "@ckeditor/ckeditor5-mention": "45.0.0-alpha.8",
19
+ "@ckeditor/ckeditor5-typing": "45.0.0-alpha.8",
20
+ "@ckeditor/ckeditor5-ui": "45.0.0-alpha.8",
21
+ "@ckeditor/ckeditor5-utils": "45.0.0-alpha.8",
22
+ "ckeditor5": "45.0.0-alpha.8",
23
23
  "fuzzysort": "3.1.0",
24
24
  "es-toolkit": "1.32.0"
25
25
  },
@@ -82,6 +82,8 @@ export default class EmojiPicker extends Plugin {
82
82
  private _createEmojiPickerFormView;
83
83
  /**
84
84
  * Hides the balloon with the emoji picker.
85
+ *
86
+ * @param updateFocus Whether to focus the editor after closing the emoji picker.
85
87
  */
86
88
  private _hideUI;
87
89
  /**
@@ -179,18 +179,28 @@ export default class EmojiPicker extends Plugin {
179
179
  clickOutsideHandler({
180
180
  emitter: emojiPickerFormView,
181
181
  contextElements: [this.balloonPlugin.view.element],
182
- callback: () => this._hideUI(),
182
+ callback: () => {
183
+ // Focusing on the editable during a click outside the balloon panel might
184
+ // cause the selection to move to the beginning of the editable, so we avoid
185
+ // focusing on it during this action.
186
+ // See: https://github.com/ckeditor/ckeditor5/issues/18253
187
+ this._hideUI(false);
188
+ },
183
189
  activator: () => this.balloonPlugin.visibleView === emojiPickerFormView
184
190
  });
185
191
  return emojiPickerFormView;
186
192
  }
187
193
  /**
188
194
  * Hides the balloon with the emoji picker.
195
+ *
196
+ * @param updateFocus Whether to focus the editor after closing the emoji picker.
189
197
  */
190
- _hideUI() {
198
+ _hideUI(updateFocus = true) {
191
199
  this.balloonPlugin.remove(this.emojiPickerFormView);
192
200
  this.emojiPickerView.searchView.setInputValue('');
193
- this.editor.editing.view.focus();
201
+ if (updateFocus) {
202
+ this.editor.editing.view.focus();
203
+ }
194
204
  this._hideFakeVisualSelection();
195
205
  }
196
206
  /**