mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 10:38:11 +08:00
fix(composer-emoji): Fix setBaseAndExtent bug
This commit is contained in:
parent
380d0a9e76
commit
e574c2ecf7
1 changed files with 4 additions and 2 deletions
|
@ -12,10 +12,12 @@ class EmojiComposerExtension extends ContenteditableExtension {
|
|||
if (emojiOptions.length > 0) {
|
||||
const offset = sel.anchorOffset;
|
||||
if (!DOMUtils.closest(sel.anchorNode, "n1-emoji-autocomplete")) {
|
||||
const anchorOffset = Math.max(sel.anchorOffset - triggerWord.length - 1, 0);
|
||||
editor.select(sel.anchorNode,
|
||||
sel.anchorOffset - triggerWord.length - 1,
|
||||
anchorOffset,
|
||||
sel.focusNode,
|
||||
sel.focusOffset).wrapSelection("n1-emoji-autocomplete");
|
||||
sel.focusOffset)
|
||||
editor.wrapSelection("n1-emoji-autocomplete");
|
||||
editor.select(sel.anchorNode,
|
||||
offset,
|
||||
sel.anchorNode,
|
||||
|
|
Loading…
Reference in a new issue