diff --git a/ts/quill/signal-clipboard/index.ts b/ts/quill/signal-clipboard/index.ts index 43e15df6a225..47f618eb4004 100644 --- a/ts/quill/signal-clipboard/index.ts +++ b/ts/quill/signal-clipboard/index.ts @@ -38,8 +38,6 @@ export class SignalClipboard { return; } - this.quill.focus(); - const clipboard = this.quill.getModule('clipboard'); const selection = this.quill.getSelection(); @@ -72,8 +70,10 @@ export class SignalClipboard { .delete(selection.length) .concat(clipboardDelta); this.quill.updateContents(delta, 'user'); - this.quill.setSelection(delta.length(), 0, 'silent'); + this.quill.setSelection(delta.length() - selection.length, 0, 'silent'); this.quill.scrollingContainer.scrollTop = scrollTop; + + this.quill.focus(); }, 1); } }