Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Mobile: Fix seed text input issues (#1291)
Browse files Browse the repository at this point in the history
* Mobile: Remove push to mask and fix Android letter duplication

* Mobile: Remove unused textinput prop
  • Loading branch information
cvarley100 committed Apr 12, 2019
1 parent e248a38 commit 3bf6322
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mobile/src/ui/components/CustomTextInput.js
Expand Up @@ -8,6 +8,7 @@ import { Checksum } from 'ui/components/Checksum';
import { isAndroid } from 'libs/device';
import { stringToUInt8, UInt8ToString } from 'libs/crypto';
import { trytesToTrits, tritsToChars } from 'shared-modules/libs/iota/converter';
import { VALID_SEED_REGEX } from 'shared-modules/libs/iota/utils';

const styles = StyleSheet.create({
fieldContainer: {
Expand Down Expand Up @@ -215,10 +216,10 @@ class CustomTextInput extends Component {
onChangeText(value) {
const { isPasswordInput, isSeedInput, onValidTextChange } = this.props;
if (isSeedInput) {
if (value && !value.match(/^[a-zA-Z9]+$/)) {
if (value && !value.match(VALID_SEED_REGEX)) {
return;
}
return onValidTextChange(trytesToTrits(value.toUpperCase()));
return onValidTextChange(trytesToTrits(value));
} else if (isPasswordInput) {
return onValidTextChange(stringToUInt8(value));
}
Expand Down Expand Up @@ -302,8 +303,7 @@ class CustomTextInput extends Component {
const { theme, containerStyle } = this.props;
return (
<TouchableOpacity
onPressIn={() => this.onSecretMaskPress()}
onPressOut={() => this.onSecretMaskPress()}
onPress={() => this.onSecretMaskPress()}
style={styles.widgetButton}
hitSlop={{ top: height / 60, bottom: height / 60, left: width / 75, right: width / 75 }}
>
Expand Down

0 comments on commit 3bf6322

Please sign in to comment.