feature: dismiss keyboard after sign in/register/passcode creation

This commit is contained in:
Radek Czemerys
2020-08-20 00:12:03 +02:00
parent 3cf95e9fbf
commit b8f600d12c
2 changed files with 5 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ import { ApplicationContext } from '@Root/ApplicationContext';
import { SCREEN_INPUT_MODAL_PASSCODE } from '@Screens/screens';
import { StyleKitContext } from '@Style/StyleKit';
import React, { useContext, useMemo, useRef, useState } from 'react';
import { KeyboardType, Platform, TextInput } from 'react-native';
import { Keyboard, KeyboardType, Platform, TextInput } from 'react-native';
import { Container, Input } from './InputModal.styled';
type Props = ModalStackNavigationProp<typeof SCREEN_INPUT_MODAL_PASSCODE>;
@@ -34,7 +34,7 @@ export const PasscodeInputModal = (props: Props) => {
if (!confirmText) {
confirmTextRef.current?.focus();
} else {
// this.submit();
Keyboard.dismiss();
}
};

View File

@@ -6,6 +6,7 @@ import { TableSection } from '@Components/TableSection';
import { ApplicationContext } from '@Root/ApplicationContext';
import { StyleKitContext } from '@Style/StyleKit';
import React, { useCallback, useContext, useEffect, useState } from 'react';
import { Keyboard } from 'react-native';
import {
RegistrationDescription,
RegistrationInput,
@@ -96,7 +97,7 @@ export const AuthSection = (props: Props) => {
setSigningIn(false);
return;
}
Keyboard.dismiss();
const result = await application!.signIn(
email,
password,
@@ -144,6 +145,7 @@ export const AuthSection = (props: Props) => {
'OK'
);
} else {
Keyboard.dismiss();
const result = await application!.register(
email,
password,