@shoutem/ui 4.9.0 → 4.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/TextInput.js +14 -1
- package/package.json +1 -1
package/components/TextInput.js
CHANGED
|
@@ -19,10 +19,22 @@ class TextInput extends PureComponent {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
handleBlur() {
|
|
22
|
+
const { onBlur } = this.props;
|
|
23
|
+
|
|
24
|
+
if (onBlur) {
|
|
25
|
+
onBlur();
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
this.setState({ isFocused: false });
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
handleFocus() {
|
|
32
|
+
const { onFocus } = this.props;
|
|
33
|
+
|
|
34
|
+
if (onFocus) {
|
|
35
|
+
onFocus();
|
|
36
|
+
}
|
|
37
|
+
|
|
26
38
|
this.setState({ isFocused: true });
|
|
27
39
|
}
|
|
28
40
|
|
|
@@ -44,6 +56,7 @@ class TextInput extends PureComponent {
|
|
|
44
56
|
withBorder,
|
|
45
57
|
withoutBorder,
|
|
46
58
|
wiggleAnimation,
|
|
59
|
+
errorText,
|
|
47
60
|
...otherStyle
|
|
48
61
|
} = style;
|
|
49
62
|
|
|
@@ -68,7 +81,7 @@ class TextInput extends PureComponent {
|
|
|
68
81
|
/>
|
|
69
82
|
</Wiggle>
|
|
70
83
|
{!!errorMessage && (
|
|
71
|
-
<Caption styleName="form-error sm-gutter-top">{errorMessage}</Caption>
|
|
84
|
+
<Caption styleName="form-error sm-gutter-top" style={errorText}>{errorMessage}</Caption>
|
|
72
85
|
)}
|
|
73
86
|
</View>
|
|
74
87
|
);
|