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 currentlyFocusedField by Removing this usage in TextInputState #19834

Closed

Conversation

janicduplessis
Copy link
Contributor

@janicduplessis janicduplessis commented Jun 21, 2018

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.

Test Plan:

Tested that calling currentlyFocusedField actually returns a value if a text input is focused.

Release Notes:

[GENERAL] [BUGFIX] [TextInputState] - Fix currentlyFocusedField by Removing this usage in TextInputState

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 21, 2018
@react-native-bot react-native-bot added ✅Test Plan Component: TextInput Related to the TextInput component. labels Jun 21, 2018
@ghost
Copy link

ghost commented Jul 8, 2018

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.

@janicduplessis
Copy link
Contributor Author

cc @hramos

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Jul 20, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@react-native-bot
Copy link
Collaborator

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 master tag, it is not yet part of a release.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Merged This PR has been merged. label Jul 21, 2018
CarlaTeo pushed a commit to projetoeureka/react-native that referenced this pull request Aug 29, 2018
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
grabbou pushed a commit that referenced this pull request Sep 10, 2018
#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
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Component: TextInput Related to the TextInput component. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants