File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -62,3 +62,8 @@ Custom theme for component. By default provided by the ThemeProvider.
62
62
** type:** ` string `
63
63
64
64
Value of TextInput
65
+
66
+ ### ` clearButton `
67
+ ** type** ` boolean `
68
+
69
+ Display the custom button to clear the input. By default the button is shown.
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ type Props = {
12
12
theme : Theme ,
13
13
placeholder ?: string ,
14
14
value : string ,
15
+ clearButton ?: boolean ,
15
16
onValueChange ?: ( text : string ) => void ,
16
17
containerStyle ? : StyleObj ,
17
18
inputStyle ?: StyleObj ,
@@ -25,6 +26,7 @@ class TextField extends React.Component<Props> {
25
26
value,
26
27
placeholder,
27
28
onValueChange,
29
+ clearButton,
28
30
theme : {
29
31
backgroundColor,
30
32
dividerColor,
@@ -53,7 +55,7 @@ class TextField extends React.Component<Props> {
53
55
style = { [ styles . input , { color : textColor } , inputStyle ] }
54
56
selectionColor = { primaryColor }
55
57
/>
56
- { value ? (
58
+ { value && clearButton !== false ? (
57
59
< TouchableOpacity onPress = { this . clearInput } >
58
60
< Icon
59
61
name = "ios-close-circle"
You can’t perform that action at this time.
0 commit comments