Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(wallet-mobile): display native kb for device pin #3653

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from
9 changes: 8 additions & 1 deletion apps/wallet-mobile/src/features/Auth/PinInput/PinInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {useTheme} from '@yoroi/theme'
import _ from 'lodash'
import React, {useEffect, useRef} from 'react'
rahulnr7 marked this conversation as resolved.
Show resolved Hide resolved
rahulnr7 marked this conversation as resolved.
Show resolved Hide resolved
import {StyleSheet, TextInput, View} from 'react-native'
import {InteractionManager} from 'react-native'

import {Spacer} from '../../../components/Spacer/Spacer'
import {Text} from '../../../components/Text'
Expand Down Expand Up @@ -30,7 +31,13 @@ export const PinInput = React.forwardRef<PinInputRef, Props>((props, ref) => {

useEffect(() => {
rahulnr7 marked this conversation as resolved.
Show resolved Hide resolved
rahulnr7 marked this conversation as resolved.
Show resolved Hide resolved
if (enabled) {
inputRef.current?.focus()
const interaction = InteractionManager.runAfterInteractions(() => {
const timer = setTimeout(() => {
inputRef.current?.focus()
}, 300)
return () => clearTimeout(timer)
})
return () => interaction.cancel()
}
}, [enabled])

Expand Down
Loading