forked from firka/flutter
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user