浏览代码

fix text field crash (merged from ConnectApp)

/main
xingwei.zhu 5 年前
当前提交
77658f2a
共有 1 个文件被更改,包括 5 次插入8 次删除
  1. 13
      Runtime/Plugins/platform/ios/UIWidgetsTextInputPlugin.mm

13
Runtime/Plugins/platform/ios/UIWidgetsTextInputPlugin.mm


[self.inputDelegate textWillChange:self];
[self.text setString:newText];
}
NSInteger composingBase = [state[@"composingBase"] intValue];
NSInteger composingExtent = [state[@"composingExtent"] intValue];
NSRange composingRange = [self clampSelection:NSMakeRange(MIN(composingBase, composingExtent), ABS(composingBase - composingExtent)) forText:self.text];
self.markedTextRange = composingRange.length > 0 ? [UIWidgetsTextRange rangeWithNSRange:composingRange] : nil;
NSInteger selectionBase = [state[@"selectionBase"] intValue];
NSInteger selectionExtent = [state[@"selectionExtent"] intValue];

_selectionAffinity = _kTextAffinityUpstream;
[self.inputDelegate selectionDidChange:self];
}
NSInteger composingBase = [state[@"composingBase"] intValue];
NSInteger composingExtent = [state[@"composingExtent"] intValue];
NSRange composingRange = [self clampSelection:NSMakeRange(MIN(composingBase, composingExtent),
ABS(composingBase - composingExtent))
forText:self.text];
self.markedTextRange =
composingRange.length > 0 ? [UIWidgetsTextRange rangeWithNSRange:composingRange] : nil;
if (textChanged) {
[self.inputDelegate textDidChange:self];

正在加载...
取消
保存