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 https://github.com/facebook/react-native/pull/18040 Differential Revision: D7078736 Pulled By: hramos fbshipit-source-id: 798530729d7f0ee1ebb59f698af4d4b6ff43928b
This commit is contained in:
parent
0ee03178a0
commit
8a073c1d8b
|
@ -880,7 +880,7 @@ const TextInput = createReactClass({
|
|||
|
||||
return (
|
||||
<TouchableWithoutFeedback
|
||||
onLayout={this._onLayout}
|
||||
onLayout={props.onLayout}
|
||||
onPress={this._onPress}
|
||||
accessible={this.props.accessible}
|
||||
accessibilityLabel={this.props.accessibilityLabel}
|
||||
|
|
Loading…
Reference in New Issue