Skip to content

Commit

Permalink
Fix onChangeText not firing when clearing the value of TextInput with…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
kkoudev authored and facebook-github-bot committed Jul 4, 2023
1 parent c0b2770 commit 0c9c57a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ - (BOOL)textView:(__unused UITextView *)textView shouldChangeTextInRange:(NSRang

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

0 comments on commit 0c9c57a

Please sign in to comment.