Skip to content

Commit

Permalink
CompositionInput: Properly set cursor right after pasted data
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed May 22, 2023
1 parent 99011b0 commit afae6bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ts/quill/signal-clipboard/index.ts
Expand Up @@ -38,8 +38,6 @@ export class SignalClipboard {
return;
}

this.quill.focus();

const clipboard = this.quill.getModule('clipboard');
const selection = this.quill.getSelection();

Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit afae6bc

Please sign in to comment.