Skip to content

Commit

Permalink
Fix empty composing range on iOS (flutter#10381)
Browse files Browse the repository at this point in the history
  • Loading branch information
goderbauer authored Aug 7, 2019
1 parent b5eacfc commit f2f84ca
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 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;
Expand Down

0 comments on commit f2f84ca

Please sign in to comment.