Skip to content

Commit 44c8caf

Browse files
authored
Add auto-expanding multiline TextInput example to RNTester (#59416)
Summary: Add a new RNTester example in TextInputSharedExamples to reproduce iOS and Android issues with auto-expanding multiline text fields. There is already an existing example, but an empty, uncontrolled variant is needed to reproduce certain issues. An existing iOS-only auto-expanding example is removed as well since it duplicates functionality. Changelog: [Internal] Reviewed By: vzaidman Differential Revision: D127048669 Pull Request resolved: #59416
1 parent 771f8c7 commit 44c8caf

2 files changed

Lines changed: 14 additions & 17 deletions

File tree

‎packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -778,23 +778,6 @@ const textInputExamples: Array<RNTesterModuleExample> = [
778778
);
779779
},
780780
},
781-
{
782-
title: 'Auto-expanding',
783-
render: function (): React.Node {
784-
return (
785-
<View>
786-
<ExampleTextInput
787-
placeholder="height increases with content"
788-
defaultValue="React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native."
789-
multiline={true}
790-
enablesReturnKeyAutomatically={true}
791-
returnKeyType="go"
792-
style={[styles.multiline, styles.multilineExpandable]}
793-
/>
794-
</View>
795-
);
796-
},
797-
},
798781
{
799782
title: 'TextInput maxLength',
800783
render: function (): React.Node {

‎packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,20 @@ module.exports = [
11921192
);
11931193
},
11941194
},
1195+
{
1196+
title: 'Auto-expanding (uncontrolled)',
1197+
render: function (): React.Node {
1198+
return (
1199+
<View>
1200+
<ExampleTextInput
1201+
placeholder="height should grow up to 10 lines"
1202+
multiline={true}
1203+
numberOfLines={10}
1204+
/>
1205+
</View>
1206+
);
1207+
},
1208+
},
11951209
{
11961210
title: 'Drag and drop',
11971211
render: function (): React.Node {

0 commit comments

Comments
 (0)