[change] TextInput uses DOM elements

This patch changes TextInput to use DOM inputs directly, rather than
trying to reimplement 'placeholder'. Removes support for
'placeholderTextColor'.

Fix #54
Fix #224
Fix #229
Fix #235
Fix #253
This commit is contained in:
Nicolas Gallagher
2016-11-21 16:52:40 -08:00
parent 4005f9ddde
commit 89f5a13891
5 changed files with 57 additions and 181 deletions
@@ -210,25 +210,16 @@ class TokenizedTextExample extends React.Component {
}
parts.push(_text);
//highlight hashtags
parts = parts.map((text) => {
if (/^#/.test(text)) {
return <Text key={text} style={styles.hashtag}>{text}</Text>;
} else {
return text;
}
});
return (
<View>
<TextInput
value={parts.join('')}
multiline={true}
style={styles.multiline}
onChangeText={(text) => {
this.setState({text});
}}>
<Text>{parts}</Text>
</TextInput>
}}
/>
</View>
);
}
@@ -279,7 +270,7 @@ class BlurOnSubmitExample extends React.Component {
<TextInput
ref="5"
style={styles.default}
keyboardType="numbers-and-punctuation"
keyboardType="numeric"
placeholder="blurOnSubmit = true"
returnKeyType="done"
/>
@@ -519,15 +510,15 @@ const examples = [
render: function() {
var keyboardTypes = [
'default',
'ascii-capable',
'numbers-and-punctuation',
//'ascii-capable',
//'numbers-and-punctuation',
'url',
'number-pad',
'phone-pad',
'name-phone-pad',
//'name-phone-pad',
'email-address',
'decimal-pad',
'twitter',
//'decimal-pad',
//'twitter',
'web-search',
'numeric',
];
@@ -776,14 +767,6 @@ const examples = [
style={styles.multiline}
dataDetectorTypes="phoneNumber"
/>
<TextInput
placeholder="multiline with children"
multiline={true}
enablesReturnKeyAutomatically={true}
returnKeyType="go"
style={styles.multiline}>
<View style={styles.multilineChild}/>
</TextInput>
</View>
);
}