Implement TextInput.clearButtonMode added by D1875684 on OSS fork + example
This commit is contained in:
parent
c7b5a1ddfa
commit
078300ce08
|
@ -185,4 +185,37 @@ exports.examples = [
|
|||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Clear button mode',
|
||||
render: function () {
|
||||
return (
|
||||
<View>
|
||||
<WithLabel label="never">
|
||||
<TextInput
|
||||
style={styles.default}
|
||||
clearButtonMode={TextInput.clearButtonModeTypes.never}
|
||||
/>
|
||||
</WithLabel>
|
||||
<WithLabel label="while editing">
|
||||
<TextInput
|
||||
style={styles.default}
|
||||
clearButtonMode={TextInput.clearButtonModeTypes.whileEditing}
|
||||
/>
|
||||
</WithLabel>
|
||||
<WithLabel label="unless editing">
|
||||
<TextInput
|
||||
style={styles.default}
|
||||
clearButtonMode={TextInput.clearButtonModeTypes.unlessEditing}
|
||||
/>
|
||||
</WithLabel>
|
||||
<WithLabel label="always">
|
||||
<TextInput
|
||||
style={styles.default}
|
||||
clearButtonMode={TextInput.clearButtonModeTypes.always}
|
||||
/>
|
||||
</WithLabel>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
},
|
||||
];
|
||||
|
|
|
@ -1293,6 +1293,14 @@ static void RCTSetShadowViewProps(NSDictionary *props, RCTShadowView *shadowView
|
|||
@"None": @(UITextAutocapitalizationTypeNone),
|
||||
},
|
||||
},
|
||||
@"UITextField": @{
|
||||
@"clearButtonMode": @{
|
||||
@"Never": @(UITextFieldViewModeNever),
|
||||
@"WhileEditing": @(UITextFieldViewModeWhileEditing),
|
||||
@"UnlessEditing": @(UITextFieldViewModeUnlessEditing),
|
||||
@"Always": @(UITextFieldViewModeAlways),
|
||||
},
|
||||
},
|
||||
@"UIView": @{
|
||||
@"ContentMode": @{
|
||||
@"ScaleToFill": @(UIViewContentModeScaleToFill),
|
||||
|
|
|
@ -19,6 +19,7 @@ RCT_EXPORT_VIEW_PROPERTY(enabled)
|
|||
RCT_EXPORT_VIEW_PROPERTY(placeholder)
|
||||
RCT_EXPORT_VIEW_PROPERTY(text)
|
||||
RCT_EXPORT_VIEW_PROPERTY(font)
|
||||
RCT_EXPORT_VIEW_PROPERTY(clearButtonMode)
|
||||
RCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType)
|
||||
RCT_EXPORT_VIEW_PROPERTY(keyboardType)
|
||||
RCT_REMAP_VIEW_PROPERTY(color, textColor)
|
||||
|
|
Loading…
Reference in New Issue