Skip to content

Commit 7f47644

Browse files
committed
Issue#11068 [Android] Add TextInput Example for LowerCase rewrite
1 parent eb6e04d commit 7f47644

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,30 @@ class RewriteExample extends React.Component<$FlowFixMeProps, any> {
135135
}
136136
}
137137

138+
class RewriteToLowerCaseExample extends React.Component<$FlowFixMeProps, any> {
139+
constructor(props: any | void) {
140+
super(props);
141+
this.state = {text: ''};
142+
}
143+
render(): React.Node {
144+
return (
145+
<View style={styles.rewriteContainer}>
146+
<TextInput
147+
testID="rewrite_to_lowercase_input"
148+
autoCorrect={false}
149+
multiline={false}
150+
onChangeText={text => {
151+
text = text.toLowerCase();
152+
this.setState({text});
153+
}}
154+
style={styles.default}
155+
value={this.state.text}
156+
/>
157+
</View>
158+
);
159+
}
160+
}
161+
138162
class RewriteExampleInvalidCharacters extends React.Component<
139163
$FlowFixMeProps,
140164
any,
@@ -854,6 +878,13 @@ module.exports = ([
854878
return <RewriteExample />;
855879
},
856880
},
881+
{
882+
name: 'lowerCase',
883+
title: 'Live Re-Write to LowerCase',
884+
render: function (): React.Node {
885+
return <RewriteToLowerCaseExample />;
886+
},
887+
},
857888
{
858889
title: 'Live Re-Write (no spaces allowed)',
859890
render: function (): React.Node {

0 commit comments

Comments
 (0)