-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 currentlyFocusedField
by Removing this
usage in TextInputState
#19834
Fix currentlyFocusedField
by Removing this
usage in TextInputState
#19834
Conversation
Just found this issue, realized that currentlyFocusedField was returning undefined and thus not properly avoiding the keyboard from this library: https://github.com/APSL/react-native-keyboard-aware-scroll-view/blob/master/lib/KeyboardAwareHOC.js#L301. Patching this PR does fix the issue. |
cc @hramos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was closed by @janicduplessis in b4b594c. Once this commit is added to a release, you will see the corresponding version tag below the description at b4b594c. If the commit has a single |
facebook#19834) Summary: I broke `currentlyFocusedField` when adding it back in ce3b7b8 because `this` no longer refers to the proper object because it is assigned here facebook@ce3b7b8#diff-b48972356bc8dca4a00747d002fc3dd5R330. This code was pretty prone to breaking so I simply removed the `this` usage and rely on a top level variable instead. Also moved everything to named functions. Pull Request resolved: facebook#19834 Differential Revision: D8943088 Pulled By: hramos fbshipit-source-id: 24d1470f6117138a5978fb7e467147847a9f3658
#19834) Summary: I broke `currentlyFocusedField` when adding it back in ce3b7b8 because `this` no longer refers to the proper object because it is assigned here ce3b7b8#diff-b48972356bc8dca4a00747d002fc3dd5R330. This code was pretty prone to breaking so I simply removed the `this` usage and rely on a top level variable instead. Also moved everything to named functions. Pull Request resolved: #19834 Differential Revision: D8943088 Pulled By: hramos fbshipit-source-id: 24d1470f6117138a5978fb7e467147847a9f3658
I broke
currentlyFocusedField
when adding it back in ce3b7b8 becausethis
no longer refers to the proper object because it is assigned here ce3b7b8#diff-b48972356bc8dca4a00747d002fc3dd5R330. This code was pretty prone to breaking so I simply removed thethis
usage and rely on a top level variable instead. Also moved everything to named functions.Test Plan:
Tested that calling currentlyFocusedField actually returns a value if a text input is focused.
Release Notes:
[GENERAL] [BUGFIX] [TextInputState] - Fix
currentlyFocusedField
by Removingthis
usage in TextInputState