mirror of
https://github.com/status-im/react-native.git
synced 2025-02-10 16:36:25 +00:00
Refactor text input props
Summary: Just cleaning the props for android rendering, similar to iOS Reviewed By: foghina Differential Revision: D3735324 fbshipit-source-id: aaf222543701409710a2cd217cc580e79f23bf7b
This commit is contained in:
parent
e4d5dcb15b
commit
959c8b170e
@ -658,7 +658,9 @@ const TextInput = React.createClass({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var autoCapitalize =
|
const props = Object.assign({}, this.props);
|
||||||
|
props.style = [this.props.style];
|
||||||
|
props.autoCapitalize =
|
||||||
UIManager.AndroidTextInput.Constants.AutoCapitalizationType[this.props.autoCapitalize];
|
UIManager.AndroidTextInput.Constants.AutoCapitalizationType[this.props.autoCapitalize];
|
||||||
var children = this.props.children;
|
var children = this.props.children;
|
||||||
var childCount = 0;
|
var childCount = 0;
|
||||||
@ -671,39 +673,18 @@ const TextInput = React.createClass({
|
|||||||
children = <Text>{children}</Text>;
|
children = <Text>{children}</Text>;
|
||||||
}
|
}
|
||||||
|
|
||||||
var textContainer =
|
const textContainer =
|
||||||
<AndroidTextInput
|
<AndroidTextInput
|
||||||
ref="input"
|
ref="input"
|
||||||
style={[this.props.style]}
|
{...props}
|
||||||
autoCapitalize={autoCapitalize}
|
|
||||||
autoCorrect={this.props.autoCorrect}
|
|
||||||
keyboardType={this.props.keyboardType}
|
|
||||||
mostRecentEventCount={0}
|
mostRecentEventCount={0}
|
||||||
multiline={this.props.multiline}
|
|
||||||
numberOfLines={this.props.numberOfLines}
|
|
||||||
maxLength={this.props.maxLength}
|
|
||||||
onFocus={this._onFocus}
|
onFocus={this._onFocus}
|
||||||
onBlur={this._onBlur}
|
onBlur={this._onBlur}
|
||||||
onChange={this._onChange}
|
onChange={this._onChange}
|
||||||
onContentSizeChange={this.props.onContentSizeChange}
|
|
||||||
onSelectionChange={onSelectionChange}
|
onSelectionChange={onSelectionChange}
|
||||||
onTextInput={this._onTextInput}
|
onTextInput={this._onTextInput}
|
||||||
onEndEditing={this.props.onEndEditing}
|
|
||||||
onSubmitEditing={this.props.onSubmitEditing}
|
|
||||||
blurOnSubmit={this.props.blurOnSubmit}
|
|
||||||
placeholder={this.props.placeholder}
|
|
||||||
placeholderTextColor={this.props.placeholderTextColor}
|
|
||||||
secureTextEntry={this.props.secureTextEntry}
|
|
||||||
selectionColor={this.props.selectionColor}
|
|
||||||
text={this._getText()}
|
text={this._getText()}
|
||||||
underlineColorAndroid={this.props.underlineColorAndroid}
|
|
||||||
inlineImageLeft={this.props.inlineImageLeft}
|
|
||||||
inlineImagePadding={this.props.inlineImagePadding}
|
|
||||||
children={children}
|
children={children}
|
||||||
editable={this.props.editable}
|
|
||||||
selectTextOnFocus={this.props.selectTextOnFocus}
|
|
||||||
returnKeyType={this.props.returnKeyType}
|
|
||||||
returnKeyLabel={this.props.returnKeyLabel}
|
|
||||||
/>;
|
/>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user