Composer/cut: Rely on Quill to update both DOM and its internal state

This commit is contained in:
Scott Nonnenberg
2025-03-20 04:29:53 +10:00
committed by GitHub
parent a6150659a3
commit 1464fe7373

View File

@@ -33,10 +33,10 @@ export class SignalClipboard {
const [range] = this.quill.selection.getRange(); const [range] = this.quill.selection.getRange();
// This updates the clipboard with what we want // This updates the clipboard with what we want
const handler = createEventHandler({ deleteSelection: true }); const handler = createEventHandler({ deleteSelection: false });
handler(event); handler(event);
// And this updates quill's internal state to reflect the cut // And this updates quill's internal state and the content-editable to reflect the cut
if (range) { if (range) {
deleteRange({ range, quill: this.quill }); deleteRange({ range, quill: this.quill });
} }