diff --git a/lib/text-input-mask.js b/lib/text-input-mask.js index d092fb65..2ee7e9d4 100644 --- a/lib/text-input-mask.js +++ b/lib/text-input-mask.js @@ -1,15 +1,18 @@ import React, { Component } from 'react'; import { - StyleSheet, - TextInput + StyleSheet, + TextInput } from 'react-native'; import BaseTextComponent from './base-text-component'; const INPUT_TEXT_REF = '$input-text'; +let Input = TextInput + export default class TextInputMask extends BaseTextComponent { constructor(props) { super(props); + if (props.customTextInput) Input = props.customTextInput } getElement() { @@ -19,20 +22,20 @@ export default class TextInputMask extends BaseTextComponent { _onChangeText(text) { let self = this; - if(!this._checkText(text)) { + if (!this._checkText(text)) { return; } self.updateValue(text) .then(maskedText => { - if(self.props.onChangeText) { + if (self.props.onChangeText) { self.props.onChangeText(maskedText); } }); } _checkText(text) { - if(this.props.checkText) { + if (this.props.checkText) { return this.props.checkText(this.state.value, text); } @@ -41,13 +44,13 @@ export default class TextInputMask extends BaseTextComponent { render() { return ( - this._onChangeText(text)} value={this.state.value} - /> + /> ); } }