From 44f75e793e97e8d24a9e7b0c3b377345fae200ff Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Thu, 1 Aug 2019 11:51:18 +0200 Subject: [PATCH 1/2] Fix empty composing range on iOS --- .../darwin/ios/framework/Source/FlutterTextInputPlugin.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 1a056f365c996..d9c6a0fb45e61 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -591,8 +591,9 @@ - (void)updateEditingState { NSUInteger selectionBase = ((FlutterTextPosition*)_selectedTextRange.start).index; NSUInteger selectionExtent = ((FlutterTextPosition*)_selectedTextRange.end).index; - NSUInteger composingBase = 0; - NSUInteger composingExtent = 0; + // Empty compositing range is represented by [TextRange.empty]. + NSInteger composingBase = -1; + NSInteger composingExtent = -1; if (self.markedTextRange != nil) { composingBase = ((FlutterTextPosition*)self.markedTextRange.start).index; composingExtent = ((FlutterTextPosition*)self.markedTextRange.end).index; From 31b8d03399dc412f6935c363e4ba41b415af8fd1 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Mon, 5 Aug 2019 10:41:32 -0700 Subject: [PATCH 2/2] review feedback --- .../darwin/ios/framework/Source/FlutterTextInputPlugin.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index d9c6a0fb45e61..63c502e4e2b91 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -591,7 +591,7 @@ - (void)updateEditingState { NSUInteger selectionBase = ((FlutterTextPosition*)_selectedTextRange.start).index; NSUInteger selectionExtent = ((FlutterTextPosition*)_selectedTextRange.end).index; - // Empty compositing range is represented by [TextRange.empty]. + // Empty compositing range is represented by the framework's TextRange.empty. NSInteger composingBase = -1; NSInteger composingExtent = -1; if (self.markedTextRange != nil) {