diff --git a/src/CONST.js b/src/CONST.js index 5dbb241e1a25..4d10eae7a202 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -434,6 +434,7 @@ const CONST = { PHONE_PAD: 'phone-pad', NUMBER_PAD: 'number-pad', DECIMAL_PAD: 'decimal-pad', + VISIBLE_PASSWORD: 'visible-password', }, ATTACHMENT_SOURCE_ATTRIBUTE: 'data-expensify-source', diff --git a/src/components/TextInput/BaseTextInput.js b/src/components/TextInput/BaseTextInput.js index 02ebf0d3cda7..a083af0f2e16 100644 --- a/src/components/TextInput/BaseTextInput.js +++ b/src/components/TextInput/BaseTextInput.js @@ -14,6 +14,7 @@ import * as Expensicons from '../Icon/Expensicons'; import Text from '../Text'; import * as styleConst from './styleConst'; import * as StyleUtils from '../../styles/StyleUtils'; +import getSecureEntryKeyboardType from '../../libs/getSecureEntryKeyboardType'; class BaseTextInput extends Component { constructor(props) { @@ -272,6 +273,7 @@ class BaseTextInput extends Component { secureTextEntry={this.state.passwordHidden} onPressOut={this.props.onPress} showSoftInputOnFocus={!this.props.disableKeyboard} + keyboardType={getSecureEntryKeyboardType(this.props.keyboardType, this.props.secureTextEntry, this.state.passwordHidden)} /> {this.props.secureTextEntry && ( (secureTextEntry && !passwordHidden ? CONST.KEYBOARD_TYPE.VISIBLE_PASSWORD : keyboardType); diff --git a/src/libs/getSecureEntryKeyboardType/index.js b/src/libs/getSecureEntryKeyboardType/index.js new file mode 100644 index 000000000000..4e6ae86fc9aa --- /dev/null +++ b/src/libs/getSecureEntryKeyboardType/index.js @@ -0,0 +1,6 @@ +/** + * Return keyboardType passed as function parameter on Web/Desktop/iOS + * @param {String} keyboardType + * @return {String} + */ +export default keyboardType => keyboardType;