Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f2f84ca

Browse files
authored
Fix empty composing range on iOS (#10381)
1 parent b5eacfc commit f2f84ca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,9 @@ - (void)updateEditingState {
591591
NSUInteger selectionBase = ((FlutterTextPosition*)_selectedTextRange.start).index;
592592
NSUInteger selectionExtent = ((FlutterTextPosition*)_selectedTextRange.end).index;
593593

594-
NSUInteger composingBase = 0;
595-
NSUInteger composingExtent = 0;
594+
// Empty compositing range is represented by the framework's TextRange.empty.
595+
NSInteger composingBase = -1;
596+
NSInteger composingExtent = -1;
596597
if (self.markedTextRange != nil) {
597598
composingBase = ((FlutterTextPosition*)self.markedTextRange.start).index;
598599
composingExtent = ((FlutterTextPosition*)self.markedTextRange.end).index;

0 commit comments

Comments
 (0)