Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix onChangeText #647

Merged
merged 2 commits into from Nov 8, 2020
Merged

Fix onChangeText #647

merged 2 commits into from Nov 8, 2020

Conversation

jgking2
Copy link
Contributor

@jgking2 jgking2 commented Nov 2, 2020

Pull the onChangeText through the spread, similar to onBlur / onFocus.

Pull the onChangeText through the spread, similar to onBlur / onFocus.
@jgking2
Copy link
Contributor Author

jgking2 commented Nov 2, 2020

@bell-steven would you mind reviewing / merging this one?

@bell-steven
Copy link
Collaborator

@jgking2 what are you trying to solve with this PR?

@jgking2
Copy link
Contributor Author

jgking2 commented Nov 8, 2020

@bell-steven that would definitely be helpful haha. So you'll notice that the onChangeText event is mapped to _handleChangeText, but then the props are spread at the end. So basically, if you add onChangeText, you'll override the entire auto complete functionality (none of the events will fire). This pulls it out, so the spread won't overwrite it.

There's also a weird thing with the onChangeText firing immediately with an empty string, but that is probably for a reason, and we can work around that!

@bell-steven
Copy link
Collaborator

Thanks for that. Is this supposed to be a direct fix for #632?

@jgking2
Copy link
Contributor Author

jgking2 commented Nov 8, 2020

Absolutely, I encountered it myself but it's explained great there!

@bell-steven bell-steven merged commit 6832c88 into FaridSafi:master Nov 8, 2020
bell-steven added a commit that referenced this pull request Nov 8, 2020
@bell-steven bell-steven linked an issue Nov 8, 2020 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onChangeText cause flicking when is set on textInputProps
2 participants