@ckeditor/ckeditor5-emoji 45.0.0-alpha.6 → 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.6",
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.6",
17
- "@ckeditor/ckeditor5-icons": "45.0.0-alpha.6",
18
- "@ckeditor/ckeditor5-mention": "45.0.0-alpha.6",
19
- "@ckeditor/ckeditor5-typing": "45.0.0-alpha.6",
20
- "@ckeditor/ckeditor5-ui": "45.0.0-alpha.6",
21
- "@ckeditor/ckeditor5-utils": "45.0.0-alpha.6",
22
- "ckeditor5": "45.0.0-alpha.6",
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
  /**
@@ -128,6 +128,7 @@ export default class EmojiPicker extends Plugin {
128
128
  isToggleable: true
129
129
  });
130
130
  buttonView.on('execute', () => {
131
+ this.editor.editing.view.scrollToTheSelection();
131
132
  this.showUI();
132
133
  });
133
134
  return buttonView;
@@ -178,18 +179,28 @@ export default class EmojiPicker extends Plugin {
178
179
  clickOutsideHandler({
179
180
  emitter: emojiPickerFormView,
180
181
  contextElements: [this.balloonPlugin.view.element],
181
- 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
+ },
182
189
  activator: () => this.balloonPlugin.visibleView === emojiPickerFormView
183
190
  });
184
191
  return emojiPickerFormView;
185
192
  }
186
193
  /**
187
194
  * Hides the balloon with the emoji picker.
195
+ *
196
+ * @param updateFocus Whether to focus the editor after closing the emoji picker.
188
197
  */
189
- _hideUI() {
198
+ _hideUI(updateFocus = true) {
190
199
  this.balloonPlugin.remove(this.emojiPickerFormView);
191
200
  this.emojiPickerView.searchView.setInputValue('');
192
- this.editor.editing.view.focus();
201
+ if (updateFocus) {
202
+ this.editor.editing.view.focus();
203
+ }
193
204
  this._hideFakeVisualSelection();
194
205
  }
195
206
  /**