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 onLayout prop for TextInput on Android #18040

Closed
wants to merge 1 commit into from
Closed

Fix onLayout prop for TextInput on Android #18040

wants to merge 1 commit into from

Conversation

rozele
Copy link
Contributor

@rozele rozele commented Feb 21, 2018

When the autogrow prop was removed from TextInput on Android, the _onLayout helper method was removed. This helper method implemented the hook required to make autogrow work, then dispatched the onLayout event to the handler in this.props. This change points passes the onLayout handler from this.props directly to the inner component.

Motivation

I was updating copied code in react-native-windows and noticed this bug.

Test Plan

Run jest tests.

Related PRs

N/A

Release Notes

[ANDROID][MINOR][BUGFIX] [TextInput] - Fix onLayout prop for TextInput on Android

When the `autogrow` prop was removed from `TextInput` on Android, the `_onLayout` helper method was removed. This helper method implemented the hook required to make `autogrow` work, then dispatched the `onLayout` event to the handler in `this.props`. This change points passes the `onLayout` handler from `this.props` directly to the inner component.
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. cla signed labels Feb 21, 2018
@@ -880,7 +880,7 @@ const TextInput = createReactClass({

return (
<TouchableWithoutFeedback
onLayout={this._onLayout}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do this.props.onLayout to maintain equality?

Copy link
Contributor Author

@rozele rozele Feb 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janicduplessis
Copy link
Contributor

Good catch!

@facebook-github-bot shipit

@facebook-github-bot
Copy link
Contributor

Something went wrong executing that command, @hramos could you take a look?

@facebook-github-bot facebook-github-bot added Failed Commands Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 24, 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.

@janicduplessis is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants