Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

[PAY-1483] Patch RN to fix textinput multiline onchange not firing #3622

Merged
merged 2 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion packages/mobile/patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ Patch to support full screen swipe gestures in native stack. and navigation draw

## react-native+0.71.8.patch

Patch to prevent a freezing issue on some Android 13 devices when using an inverted FlatList with a lot of text or any animations. See https://github.com/facebook/react-native/issues/35350 and https://github.com/facebook/react-native/issues/30034
Patch to prevent a freezing issue on some Android 13 devices when using an inverted FlatList with a lot of text or any animations. See https://github.com/facebook/react-native/issues/35350 and https://github.com/facebook/react-native/issues/30034

Patch to fix an issue with TextInput not sending onChange events on the first character entered, when multiline is set to true. See https://github.com/facebook/react-native/issues/37784
29 changes: 29 additions & 0 deletions packages/mobile/patches/react-native+0.71.8.patch
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,35 @@ index e948a85..0814a98 100644
horizontallyInverted: {
transform: [{scaleX: -1}],
},
diff --git a/node_modules/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m b/node_modules/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m
index 1c8f8e0..0542362 100644
--- a/node_modules/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m
+++ b/node_modules/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m
@@ -256,21 +256,21 @@ - (BOOL)textView:(__unused UITextView *)textView shouldChangeTextInRange:(NSRang

- (void)textViewDidChange:(__unused UITextView *)textView
{
- if (_ignoreNextTextInputCall) {
+ if (_ignoreNextTextInputCall && [_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
_ignoreNextTextInputCall = NO;
return;
}
+ _lastStringStateWasUpdatedWith = _backedTextInputView.attributedText;
_textDidChangeIsComing = NO;
[_backedTextInputView.textInputDelegate textInputDidChange];
}

- (void)textViewDidChangeSelection:(__unused UITextView *)textView
{
- if (_lastStringStateWasUpdatedWith && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
+ if (![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
[self textViewDidChange:_backedTextInputView];
_ignoreNextTextInputCall = YES;
}
- _lastStringStateWasUpdatedWith = _backedTextInputView.attributedText;
[self textViewProbablyDidChangeSelection];
}

diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
Expand Down