File tree 3 files changed +10
-5
lines changed
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change
1
+ .DS_Store
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export default class TextInputMask extends Component {
34
34
}
35
35
36
36
componentWillReceiveProps ( nextProps ) {
37
- if ( this . props . value != nextProps . value ) {
37
+ if ( nextProps . mask && ( this . props . value !== nextProps . value ) ) {
38
38
mask ( this . props . mask , '' + nextProps . value , text =>
39
39
this . input && this . input . setNativeProps ( { text } )
40
40
) ;
@@ -56,9 +56,13 @@ export default class TextInputMask extends Component {
56
56
}
57
57
} }
58
58
onChangeText = { masked => {
59
- const _unmasked = unmask ( this . props . mask , masked , unmasked => {
60
- this . props . onChangeText && this . props . onChangeText ( masked , unmasked )
61
- } )
59
+ if ( this . props . mask ) {
60
+ const _unmasked = unmask ( this . props . mask , masked , unmasked => {
61
+ this . props . onChangeText && this . props . onChangeText ( masked , unmasked )
62
+ } )
63
+ } else {
64
+ this . props . onChangeText && this . props . onChangeText ( masked )
65
+ }
62
66
} }
63
67
/> ) ;
64
68
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-text-input-mask" ,
3
- "version" : " 0.6.1 " ,
3
+ "version" : " 0.6.2 " ,
4
4
"description" : " Text input mask for React Native on iOS and Android." ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments