Skip to content

Commit 2e259e6

Browse files
Alspbmkmkmk0706
authored andcommitted
fix(android): sync IME selection so typing follows the tapped caret (singerdmx#2746)
1 parent 535688d commit 2e259e6

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
1111
## [Unreleased]
1212

13+
### Fixed
14+
15+
- Fixed typed text being inserted at the previous caret position on Android after moving the caret with a tap/mouse by keeping the platform IME's editing state in sync with the selection even when the keyboard is hidden. (upstream #2746)
16+
1317
## [11.5.1] - 2026-05-20
1418

1519
### Added

lib/src/editor/raw_editor/raw_editor_state.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,12 @@ class QuillRawEditorState extends EditorState
10151015
_onChangeTextEditingValue(ignoreFocus);
10161016
} else {
10171017
requestKeyboard();
1018+
// Keep the platform IME's editing state (selection) in sync even when the
1019+
// soft keyboard is not (yet) visible — e.g. Android with a hardware
1020+
// keyboard. Without this, after moving the caret with a tap/mouse the IME
1021+
// keeps its stale cursor position and inserts typed text there.
1022+
// Does nothing if no input connection is open.
1023+
updateRemoteValueIfNeeded();
10181024
if (mounted) {
10191025
// Use controller.value in build()
10201026
// Mark widget as dirty and trigger build and updateChildren

0 commit comments

Comments
 (0)