Skip to content

Commit

Permalink
Make relevant TextInput examples not depend on top window size (faceb…
Browse files Browse the repository at this point in the history
…ook#44517)

Summary:

# Changelog:
[Internal] - 

A follow-up to facebook#44505, turns out this is also an issue for TextInput examples, which work of assumption of some of the text input fields being of limited width, but in practice growing to occupy the parent window width, which can be quite large on platforms different from the classic mobile ones.

This diff makes the corresponding tests more practical, not expanding to the parent window anymore.

Differential Revision: D57196308
  • Loading branch information
rshest authored and facebook-github-bot committed May 10, 2024
1 parent c647950 commit e18ee5a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ const styles = StyleSheet.create({
singleLineWithHeightTextInput: {
height: 30,
},
wrappedText: {
maxWidth: 300,
},
});

const examples: Array<RNTesterModuleExample> = [
Expand Down Expand Up @@ -380,7 +383,7 @@ const examples: Array<RNTesterModuleExample> = [
platform: 'android',
render: function (): React.Node {
return (
<View>
<View style={styles.wrappedText}>
<ExampleTextInput
numberOfLines={2}
multiline={true}
Expand Down Expand Up @@ -409,7 +412,7 @@ const examples: Array<RNTesterModuleExample> = [
title: 'Auto-expanding',
render: function (): React.Node {
return (
<View>
<View style={styles.wrappedText}>
<AutogrowingTextInputExample
enablesReturnKeyAutomatically={true}
returnKeyType="done"
Expand Down

0 comments on commit e18ee5a

Please sign in to comment.