[react_native] JS files from D1994196: [react_native] TextInput fix android viewconfig mixins: [NativeMethodsMixin, TimerMixin],

This commit is contained in:
Andrei Coman 2015-04-17 02:39:45 -07:00
parent 915151c5d7
commit af895bab53
1 changed files with 16 additions and 8 deletions

View File

@ -72,7 +72,7 @@ var notMultiline = {
onSubmitEditing: true,
};
var TextInputAndroidAttributes = {
var AndroidTextInputAttributes = {
autoCapitalize: true,
autoCorrect: true,
autoFocus: true,
@ -84,10 +84,15 @@ var TextInputAndroidAttributes = {
testID: true,
};
var AndroidTextInput = createReactIOSNativeComponentClass({
validAttributes: TextInputAndroidAttributes,
var viewConfigIOS = {
uiViewClassName: 'RCTTextField',
validAttributes: RCTTextFieldAttributes,
};
var viewConfigAndroid = {
uiViewClassName: 'AndroidTextInput',
});
validAttributes: AndroidTextInputAttributes,
};
var crossPlatformKeyboardTypeMap = {
'numeric': 'decimal-pad',
@ -293,10 +298,8 @@ var TextInput = React.createClass({
*/
mixins: [NativeMethodsMixin, TimerMixin],
viewConfig: {
uiViewClassName: 'RCTTextField',
validAttributes: RCTTextFieldAttributes,
},
viewConfig: ((Platform.OS === 'ios' ? viewConfigIOS :
(Platform.OS === 'android' ? viewConfigAndroid : {})) : Object),
isFocused: function(): boolean {
return TextInputState.currentlyFocusedField() ===
@ -591,4 +594,9 @@ var RCTTextField = createReactIOSNativeComponentClass({
uiViewClassName: 'RCTTextField',
});
var AndroidTextInput = createReactIOSNativeComponentClass({
validAttributes: AndroidTextInputAttributes,
uiViewClassName: 'AndroidTextInput',
});
module.exports = TextInput;