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
[ios] Fix onLayout support in <TextInput> #8042
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `onLayout` prop is overridden by `<TouchableWithoutFeedback>` and thus does not work on `<TextInput>` components. https://github.com/facebook/react-native/blob/fb0007d85323909ab652bf97166744fa7e17daab/Libraries/Components/Touchable/TouchableWithoutFeedback.js#L176 Test Plan: https://rnplay.org/apps/euIZtg (confirm bug) With fix, set `onLayout` on `<TextInput>` and see it is fired correctly.
By analyzing the blame information on this pull request, we identified @Bhullnatik and @dmmiller to be potential reviewers. |
ghost
added
GH Review: review-needed
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
labels
Jun 10, 2016
@facebook-github-bot shipit |
ghost
added
GH Review: accepted
Import Started
This pull request has been imported. This does not imply the PR has been approved.
and removed
GH Review: review-needed
labels
Jun 10, 2016
Thanks for importing. If you are an FB employee go to Phabricator to review. |
ghost
closed this
in
Jun 10, 2016
92926f9
I confirm, a similar fix is needed on Android |
bartolkaruza
pushed a commit
to immidi/react-native
that referenced
this pull request
Aug 3, 2016
…acebook#8042) Summary: See facebook#8042: exactly the same bug and fix on Android **Test plan** ```jsx <TextInput onLayout={function(e) { console.log(e.nativeEvent); }} /> ``` Closes facebook#9113 Differential Revision: D3647808 Pulled By: mkonicek fbshipit-source-id: 252a610e26a72a73411c3407faedea0477bee54e
samerce
pushed a commit
to iodine/react-native
that referenced
this pull request
Aug 23, 2016
Summary: The `onLayout` prop is overridden by `<TouchableWithoutFeedback>` and thus does not work on `<TextInput>` components. https://github.com/facebook/react-native/blob/fb0007d85323909ab652bf97166744fa7e17daab/Libraries/Components/Touchable/TouchableWithoutFeedback.js#L176 This makes it so the following works. ```javascript <TextInput onLayout={...} /> ``` I only tested on iOS but I assume a similar fix might be needed for Android. https://github.com/facebook/react-native/blob/fb0007d85323909ab652bf97166744fa7e17daab/Libraries/Components/TextInput/TextInput.js#L575 **Test Plan** https://rnplay.org/apps/euIZtg (confirm bug) With fix, set `onLayout` on `<TextInput>` and see it is fired correctly. ```javascript <TextInput onLayout={function(e) { console.log(e.nativeEvent); }} /> ``` Closes facebook#8042 Differential Revision: D3417192 fbshipit-source-id: 536ec81d3479e6bda474ac766b27afb39242c01a
mpretty-cyro
pushed a commit
to HomePass/react-native
that referenced
this pull request
Aug 25, 2016
Summary: The `onLayout` prop is overridden by `<TouchableWithoutFeedback>` and thus does not work on `<TextInput>` components. https://github.com/facebook/react-native/blob/fb0007d85323909ab652bf97166744fa7e17daab/Libraries/Components/Touchable/TouchableWithoutFeedback.js#L176 This makes it so the following works. ```javascript <TextInput onLayout={...} /> ``` I only tested on iOS but I assume a similar fix might be needed for Android. https://github.com/facebook/react-native/blob/fb0007d85323909ab652bf97166744fa7e17daab/Libraries/Components/TextInput/TextInput.js#L575 **Test Plan** https://rnplay.org/apps/euIZtg (confirm bug) With fix, set `onLayout` on `<TextInput>` and see it is fired correctly. ```javascript <TextInput onLayout={function(e) { console.log(e.nativeEvent); }} /> ``` Closes facebook#8042 Differential Revision: D3417192 fbshipit-source-id: 536ec81d3479e6bda474ac766b27afb39242c01a
mpretty-cyro
pushed a commit
to HomePass/react-native
that referenced
this pull request
Aug 25, 2016
…acebook#8042) Summary: See facebook#8042: exactly the same bug and fix on Android **Test plan** ```jsx <TextInput onLayout={function(e) { console.log(e.nativeEvent); }} /> ``` Closes facebook#9113 Differential Revision: D3647808 Pulled By: mkonicek fbshipit-source-id: 252a610e26a72a73411c3407faedea0477bee54e
This pull request was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Import Started
This pull request has been imported. This does not imply the PR has been approved.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
onLayout
prop is overridden by<TouchableWithoutFeedback>
and thus does not work on<TextInput>
components.react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js
Line 176 in fb0007d
This makes it so the following works.
I only tested on iOS but I assume a similar fix might be needed for Android.
react-native/Libraries/Components/TextInput/TextInput.js
Line 575 in fb0007d
Test Plan
https://rnplay.org/apps/euIZtg (confirm bug)
With fix, set
onLayout
on<TextInput>
and see it is fired correctly.