Correct behaviour for rangeForCharacterAtIndex (flutter/engine#4319)

Previously it always fell through to a zero-length character range at
the specified position.
This commit is contained in:
Chris Bracken 2017-11-02 15:16:06 -07:00 committed by GitHub
parent 9365d7465e
commit 5c6abf1dbb

View File

@ -338,7 +338,7 @@ static UITextAutocapitalizationType ToUITextAutocapitalizationType(NSString* inp
* text. */
- (NSRange)rangeForCharacterAtIndex:(NSUInteger)index {
if (index < self.text.length)
[self.text rangeOfComposedCharacterSequenceAtIndex:index];
return [self.text rangeOfComposedCharacterSequenceAtIndex:index];
return NSMakeRange(index, 0);
}