Skip to content

Commit 52143d4

Browse files
authored
Fix: Resolved issue with broken IME composing rect in Windows desktop app (singerdmx#2282)
- Fixed issue where the composing rect would break during IME conversion. - When the composing region is unknown, it now avoids calling setComposingRect on TextInputConnection.
1 parent 763a9a6 commit 52143d4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/src/editor/raw_editor/raw_editor_state_text_input_client_mixin.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ mixin RawEditorStateTextInputClientMixin on EditorState
117117
textEditingValue.composing;
118118
if (hasConnection) {
119119
assert(mounted);
120-
final offset = composingRange.isValid ? composingRange.start : 0;
121-
final composingRect =
122-
renderEditor.getLocalRectForCaret(TextPosition(offset: offset));
123-
_textInputConnection!.setComposingRect(composingRect);
120+
if (composingRange.isValid) {
121+
final offset = composingRange.start;
122+
final composingRect =
123+
renderEditor.getLocalRectForCaret(TextPosition(offset: offset));
124+
_textInputConnection!.setComposingRect(composingRect);
125+
}
124126
SchedulerBinding.instance
125127
.addPostFrameCallback((_) => _updateComposingRectIfNeeded());
126128
}

0 commit comments

Comments
 (0)