Skip to content

Commit 0c9c57a

Browse files
kkoudevfacebook-github-bot
authored andcommitted
Fix onChangeText not firing when clearing the value of TextInput with multiline=true on iOS (#37958)
Summary: This fix fixes the TextInput issue in #37784 with onChangeText not working on iOS only. ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [IOS] [FIXED] - Fix onChangeText not firing when clearing the value of TextInput with multiline=true on iOS Pull Request resolved: #37958 Test Plan: 1. Run the repro code given in the issue (#37784). 2. Verified that onChangeText works after pressing the submit button. 3. Run the repro code from the issue (#36494) that caused this issue. 4. Verified that issue (#36494) is not reoccurring. Reviewed By: rshest Differential Revision: D47185775 Pulled By: dmytrorykun fbshipit-source-id: 1a1a6534d6bf8b5bb8cf1090734dd894bab43f82
1 parent c0b2770 commit 0c9c57a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ - (BOOL)textView:(__unused UITextView *)textView shouldChangeTextInRange:(NSRang
256256

257257
- (void)textViewDidChange:(__unused UITextView *)textView
258258
{
259-
if (_ignoreNextTextInputCall) {
259+
if (_ignoreNextTextInputCall && [_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
260260
_ignoreNextTextInputCall = NO;
261261
return;
262262
}

0 commit comments

Comments
 (0)