From 4f4b54c0ee702f7179d7adba2596512261cf32d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Fern=C3=A1ndez-Capel?= Date: Thu, 1 Feb 2024 16:49:25 +0000 Subject: [PATCH] Request render after inserting replacement text The insertReplacementText text comes from an autocorrected word. If we don't request a render, the cursor will be in the wrong place and the document doesn't update until the user types another character. Fixes https://github.com/basecamp/trix/issues/1119 --- src/trix/controllers/level_2_input_controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/trix/controllers/level_2_input_controller.js b/src/trix/controllers/level_2_input_controller.js index 14707dffc..25afe9bf6 100644 --- a/src/trix/controllers/level_2_input_controller.js +++ b/src/trix/controllers/level_2_input_controller.js @@ -443,7 +443,8 @@ export default class Level2InputController extends InputController { }, insertReplacementText() { - return this.insertString(this.event.dataTransfer.getData("text/plain"), { updatePosition: false }) + this.insertString(this.event.dataTransfer.getData("text/plain"), { updatePosition: false }) + this.requestRender() }, insertText() {