Skip to content

Commit 8a073c1

Browse files
rozelefacebook-github-bot
authored andcommittedFeb 24, 2018
Fix onLayout prop for TextInput on Android
Summary: 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. <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> I was updating copied code in react-native-windows and noticed this bug. Run jest tests. N/A <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** CATEGORY [----------] TYPE [ CLI ] [-------------] LOCATION [ DOCS ] [ BREAKING ] [-------------] [ GENERAL ] [ BUGFIX ] [-{Component}-] [ INTERNAL ] [ ENHANCEMENT ] [ {File} ] [ IOS ] [ FEATURE ] [ {Directory} ] |-----------| [ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} | [----------] [-------------] [-------------] |-----------| [CATEGORY] [TYPE] [LOCATION] - MESSAGE EXAMPLES: [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see --> [ANDROID][MINOR][BUGFIX] [TextInput] - Fix `onLayout` prop for TextInput on Android Closes #18040 Differential Revision: D7078736 Pulled By: hramos fbshipit-source-id: 798530729d7f0ee1ebb59f698af4d4b6ff43928b
1 parent 0ee0317 commit 8a073c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎Libraries/Components/TextInput/TextInput.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ const TextInput = createReactClass({
880880

881881
return (
882882
<TouchableWithoutFeedback
883-
onLayout={this._onLayout}
883+
onLayout={props.onLayout}
884884
onPress={this._onPress}
885885
accessible={this.props.accessible}
886886
accessibilityLabel={this.props.accessibilityLabel}

0 commit comments

Comments
 (0)
Please sign in to comment.