[FIX] Keyboard not focusing on TwoFactor component (#2314)

* Improve 2fa visual hierarchy

* Show 2fa keyboard by scheduling focus method after all interactions

* Remove unrelated styling improvements

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Youssef Muhamad 2020-07-22 16:36:15 -03:00 committed by GitHub
parent fc324edafe
commit 8c8062ac01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { View, Text } from 'react-native';
import { View, Text, InteractionManager } from 'react-native';
import _ from 'lodash';
import PropTypes from 'prop-types';
import { sha256 } from 'js-sha256';
@ -99,6 +99,7 @@ const TwoFactor = React.memo(({ theme, isMasterDetail }) => {
<TextInput
value={code}
theme={theme}
inputRef={e => InteractionManager.runAfterInteractions(() => e?.getNativeRef()?.focus())}
returnKeyType='send'
autoCapitalize='none'
onChangeText={setCode}