Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Libraries/Text/TextInput/RCTBaseTextInputView.m
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ - (void)textInputDidBeginEditing

[_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus
reactTag:self.reactTag
text:self.backedTextInputView.attributedText.string
text:[self.backedTextInputView.attributedText.string copy] // [TODO(macOS Candidate ISS#2710739)
key:nil
eventCount:_nativeEventCount];
}
Expand All @@ -389,13 +389,13 @@ - (void)textInputDidEndEditing
{
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd
reactTag:self.reactTag
text:self.backedTextInputView.attributedText.string
text:[self.backedTextInputView.attributedText.string copy] // [TODO(macOS Candidate ISS#2710739)
key:nil
eventCount:_nativeEventCount];

[_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur
reactTag:self.reactTag
text:self.backedTextInputView.attributedText.string
text:[self.backedTextInputView.attributedText.string copy] // [TODO(macOS Candidate ISS#2710739)
key:nil
eventCount:_nativeEventCount];
}
Expand All @@ -412,7 +412,7 @@ - (BOOL)textInputShouldReturn
#endif // ]TODO(macOS Candidate ISS#2710739)
[_eventDispatcher sendTextEventWithType:RCTTextEventTypeSubmit
reactTag:self.reactTag
text:self.backedTextInputView.attributedText.string
text:[self.backedTextInputView.attributedText.string copy] // [TODO(macOS Candidate ISS#2710739)
key:nil
eventCount:_nativeEventCount];
#if TARGET_OS_OSX // [TODO(macOS Candidate ISS#2710739)
Expand Down Expand Up @@ -475,7 +475,7 @@ - (BOOL)textInputShouldChangeTextInRange:(NSRange)range replacementText:(NSStrin
}
}

NSString *previousText = backedTextInputView.attributedText.string ?: @"";
NSString *previousText = [backedTextInputView.attributedText.string copy] ?: @""; // TODO(OSS Candidate ISS#2710739)

if (range.location + range.length > backedTextInputView.attributedText.string.length) {
_predictedText = backedTextInputView.attributedText.string;
Expand Down Expand Up @@ -522,7 +522,7 @@ - (void)textInputDidChange

if (_onChange) {
_onChange(@{
@"text": self.attributedText.string,
@"text": [self.attributedText.string copy], // [TODO(macOS Candidate ISS#2710739)
@"target": self.reactTag,
@"eventCount": @(_nativeEventCount),
});
Expand Down