|
11 | 11 | 'use strict'; |
12 | 12 |
|
13 | 13 | const Button = require('Button'); |
14 | | -const InputAccessoryView = require('InputAccessoryView'); |
| 14 | +// const InputAccessoryView = require('InputAccessoryView'); |
15 | 15 | const React = require('react'); |
16 | 16 | const ReactNative = require('react-native'); |
17 | 17 | const {Text, TextInput, View, StyleSheet, Slider, Switch, Alert} = ReactNative; |
@@ -91,37 +91,37 @@ class TextEventsExample extends React.Component<{}, $FlowFixMeState> { |
91 | 91 | } |
92 | 92 | } |
93 | 93 |
|
94 | | -class TextInputAccessoryViewExample extends React.Component<{}, *> { |
95 | | - /* $FlowFixMe(>=0.85.0 site=react_native_ios_fb) This comment suppresses an |
96 | | - * error found when Flow v0.85 was deployed. To see the error, delete this |
97 | | - * comment and run Flow. */ |
98 | | - constructor(props) { |
99 | | - super(props); |
100 | | - this.state = {text: 'Placeholder Text'}; |
101 | | - } |
102 | | - |
103 | | - render() { |
104 | | - const inputAccessoryViewID = 'inputAccessoryView1'; |
105 | | - return ( |
106 | | - <View> |
107 | | - <TextInput |
108 | | - style={styles.default} |
109 | | - inputAccessoryViewID={inputAccessoryViewID} |
110 | | - onChangeText={text => this.setState({text})} |
111 | | - value={this.state.text} |
112 | | - /> |
113 | | - <InputAccessoryView nativeID={inputAccessoryViewID}> |
114 | | - <View style={{backgroundColor: 'white'}}> |
115 | | - <Button |
116 | | - onPress={() => this.setState({text: 'Placeholder Text'})} |
117 | | - title="Reset Text" |
118 | | - /> |
119 | | - </View> |
120 | | - </InputAccessoryView> |
121 | | - </View> |
122 | | - ); |
123 | | - } |
124 | | -} |
| 94 | +// class TextInputAccessoryViewExample extends React.Component<{}, *> { |
| 95 | +// /* $FlowFixMe(>=0.85.0 site=react_native_ios_fb) This comment suppresses an |
| 96 | +// * error found when Flow v0.85 was deployed. To see the error, delete this |
| 97 | +// * comment and run Flow. */ |
| 98 | +// constructor(props) { |
| 99 | +// super(props); |
| 100 | +// this.state = {text: 'Placeholder Text'}; |
| 101 | +// } |
| 102 | +// |
| 103 | +// render() { |
| 104 | +// const inputAccessoryViewID = 'inputAccessoryView1'; |
| 105 | +// return ( |
| 106 | +// <View> |
| 107 | +// <TextInput |
| 108 | +// style={styles.default} |
| 109 | +// inputAccessoryViewID={inputAccessoryViewID} |
| 110 | +// onChangeText={text => this.setState({text})} |
| 111 | +// value={this.state.text} |
| 112 | +// /> |
| 113 | +// <InputAccessoryView nativeID={inputAccessoryViewID}> |
| 114 | +// <View style={{backgroundColor: 'white'}}> |
| 115 | +// <Button |
| 116 | +// onPress={() => this.setState({text: 'Placeholder Text'})} |
| 117 | +// title="Reset Text" |
| 118 | +// /> |
| 119 | +// </View> |
| 120 | +// </InputAccessoryView> |
| 121 | +// </View> |
| 122 | +// ); |
| 123 | +// } |
| 124 | +// } |
125 | 125 |
|
126 | 126 | class RewriteExample extends React.Component<$FlowFixMeProps, any> { |
127 | 127 | /* $FlowFixMe(>=0.85.0 site=react_native_ios_fb) This comment suppresses an |
@@ -206,49 +206,25 @@ class RewriteExampleKana extends React.Component<$FlowFixMeProps, any> { |
206 | 206 | } |
207 | 207 | } |
208 | 208 |
|
209 | | -class SecureEntryExample extends React.Component<$FlowFixMeProps, any> { |
| 209 | +class PasswordExample extends React.Component<$FlowFixMeProps, any> { |
210 | 210 | /* $FlowFixMe(>=0.85.0 site=react_native_ios_fb) This comment suppresses an |
211 | 211 | * error found when Flow v0.85 was deployed. To see the error, delete this |
212 | 212 | * comment and run Flow. */ |
213 | 213 | constructor(props) { |
214 | 214 | super(props); |
215 | | - this.state = { |
216 | | - text: '', |
217 | | - password: '', |
218 | | - isSecureTextEntry: true, |
219 | | - }; |
| 215 | + this.state = {text: ''}; |
220 | 216 | } |
221 | 217 | render() { |
222 | 218 | return ( |
223 | 219 | <View> |
224 | 220 | <TextInput |
225 | | - secureTextEntry={true} |
| 221 | + password={true} |
226 | 222 | style={styles.default} |
227 | 223 | defaultValue="abc" |
228 | 224 | onChangeText={text => this.setState({text})} |
229 | 225 | value={this.state.text} |
230 | 226 | /> |
231 | 227 | <Text>Current text is: {this.state.text}</Text> |
232 | | - <View |
233 | | - style={{ |
234 | | - flex: 1, |
235 | | - flexDirection: 'row', |
236 | | - }}> |
237 | | - <TextInput |
238 | | - style={styles.default} |
239 | | - defaultValue="cde" |
240 | | - onChangeText={text => this.setState({password: text})} |
241 | | - secureTextEntry={this.state.isSecureTextEntry} |
242 | | - value={this.state.password} |
243 | | - /> |
244 | | - <Switch |
245 | | - onValueChange={value => { |
246 | | - this.setState({isSecureTextEntry: value}); |
247 | | - }} |
248 | | - style={{marginLeft: 4}} |
249 | | - value={this.state.isSecureTextEntry} |
250 | | - /> |
251 | | - </View> |
252 | 228 | </View> |
253 | 229 | ); |
254 | 230 | } |
@@ -762,9 +738,9 @@ exports.examples = [ |
762 | 738 | }, |
763 | 739 | }, |
764 | 740 | { |
765 | | - title: 'Secure text entry', |
| 741 | + title: 'Password', |
766 | 742 | render: function() { |
767 | | - return <SecureEntryExample />; |
| 743 | + return <PasswordExample />; |
768 | 744 | }, |
769 | 745 | }, |
770 | 746 | { |
@@ -937,13 +913,6 @@ exports.examples = [ |
937 | 913 | multiline={true} |
938 | 914 | style={styles.multiline} |
939 | 915 | /> |
940 | | - <TextInput |
941 | | - defaultValue="uneditable multiline text input with phone number detection: 88888888." |
942 | | - editable={false} |
943 | | - multiline={true} |
944 | | - style={styles.multiline} |
945 | | - dataDetectorTypes="phoneNumber" |
946 | | - /> |
947 | 916 | </View> |
948 | 917 | ); |
949 | 918 | }, |
|
0 commit comments