未验证 提交 3021e8f6 编写于 作者: C Chris Bracken 提交者: GitHub

Correct behaviour for rangeForCharacterAtIndex (#4319)

Previously it always fell through to a zero-length character range at
the specified position.
上级 9463b32b
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册