From f9e3a16668a58fb45f3a717e1ce77eecbc78a17a Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 7 Aug 2019 09:22:40 -0700 Subject: [PATCH] Fix empty composing range on iOS (flutter/engine#10381) --- .../darwin/ios/framework/Source/FlutterTextInputPlugin.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 1a056f365c..63c502e4e2 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -591,8 +591,9 @@ static UIReturnKeyType ToUIReturnKeyType(NSString* inputType) { NSUInteger selectionBase = ((FlutterTextPosition*)_selectedTextRange.start).index; NSUInteger selectionExtent = ((FlutterTextPosition*)_selectedTextRange.end).index; - NSUInteger composingBase = 0; - NSUInteger composingExtent = 0; + // Empty compositing range is represented by the framework's TextRange.empty. + NSInteger composingBase = -1; + NSInteger composingExtent = -1; if (self.markedTextRange != nil) { composingBase = ((FlutterTextPosition*)self.markedTextRange.start).index; composingExtent = ((FlutterTextPosition*)self.markedTextRange.end).index;