Fix empty composing range on iOS (flutter/engine#10381)

This commit is contained in:
Michael Goderbauer
2019-08-07 09:22:40 -07:00
committed by GitHub
parent c7b8d8d11f
commit f9e3a16668

View File

@@ -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;