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:
Pull Request resolved: facebook#44517

# 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.

Reviewed By: christophpurrer

Differential Revision: D57196308

fbshipit-source-id: 7018e8c51adb70fe6a03e50d71eff9ba997fd07a
  • Loading branch information
rshest authored and facebook-github-bot committed May 10, 2024
1 parent 0142f82 commit 8c3260f
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 8c3260f

Please sign in to comment.