Skip to content

Commit

Permalink
Request render after inserting replacement text
Browse files Browse the repository at this point in the history
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 #1119
  • Loading branch information
afcapel committed Feb 1, 2024
1 parent cadc7bb commit 4f4b54c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/trix/controllers/level_2_input_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 4f4b54c

Please sign in to comment.