[react_native] JS files from D1994196: [react_native] TextInput fix android viewconfig mixins: [NativeMethodsMixin, TimerMixin],
This commit is contained in:
parent
915151c5d7
commit
af895bab53
|
@ -72,7 +72,7 @@ var notMultiline = {
|
||||||
onSubmitEditing: true,
|
onSubmitEditing: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
var TextInputAndroidAttributes = {
|
var AndroidTextInputAttributes = {
|
||||||
autoCapitalize: true,
|
autoCapitalize: true,
|
||||||
autoCorrect: true,
|
autoCorrect: true,
|
||||||
autoFocus: true,
|
autoFocus: true,
|
||||||
|
@ -84,10 +84,15 @@ var TextInputAndroidAttributes = {
|
||||||
testID: true,
|
testID: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
var AndroidTextInput = createReactIOSNativeComponentClass({
|
var viewConfigIOS = {
|
||||||
validAttributes: TextInputAndroidAttributes,
|
uiViewClassName: 'RCTTextField',
|
||||||
|
validAttributes: RCTTextFieldAttributes,
|
||||||
|
};
|
||||||
|
|
||||||
|
var viewConfigAndroid = {
|
||||||
uiViewClassName: 'AndroidTextInput',
|
uiViewClassName: 'AndroidTextInput',
|
||||||
});
|
validAttributes: AndroidTextInputAttributes,
|
||||||
|
};
|
||||||
|
|
||||||
var crossPlatformKeyboardTypeMap = {
|
var crossPlatformKeyboardTypeMap = {
|
||||||
'numeric': 'decimal-pad',
|
'numeric': 'decimal-pad',
|
||||||
|
@ -293,10 +298,8 @@ var TextInput = React.createClass({
|
||||||
*/
|
*/
|
||||||
mixins: [NativeMethodsMixin, TimerMixin],
|
mixins: [NativeMethodsMixin, TimerMixin],
|
||||||
|
|
||||||
viewConfig: {
|
viewConfig: ((Platform.OS === 'ios' ? viewConfigIOS :
|
||||||
uiViewClassName: 'RCTTextField',
|
(Platform.OS === 'android' ? viewConfigAndroid : {})) : Object),
|
||||||
validAttributes: RCTTextFieldAttributes,
|
|
||||||
},
|
|
||||||
|
|
||||||
isFocused: function(): boolean {
|
isFocused: function(): boolean {
|
||||||
return TextInputState.currentlyFocusedField() ===
|
return TextInputState.currentlyFocusedField() ===
|
||||||
|
@ -591,4 +594,9 @@ var RCTTextField = createReactIOSNativeComponentClass({
|
||||||
uiViewClassName: 'RCTTextField',
|
uiViewClassName: 'RCTTextField',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var AndroidTextInput = createReactIOSNativeComponentClass({
|
||||||
|
validAttributes: AndroidTextInputAttributes,
|
||||||
|
uiViewClassName: 'AndroidTextInput',
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = TextInput;
|
module.exports = TextInput;
|
||||||
|
|
Loading…
Reference in New Issue