Skip to content

Commit

Permalink
fix: persistant scroll on each click
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwencheng committed Jul 29, 2019
1 parent 96c3539 commit 10e97b4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/screens/AccountRecover.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
'use strict';

import React from 'react';
import { Alert, SafeAreaView, ScrollView, StyleSheet, Text } from 'react-native';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
import {Alert, SafeAreaView, StyleSheet, Text, findNodeHandle} from 'react-native';
import { Subscribe } from 'unstated';

import colors from '../colors';
Expand Down Expand Up @@ -80,6 +79,9 @@ class AccountRecoverView extends React.Component {
return (
<SafeAreaView style={styles.safeAreaView}>
<KeyboardScrollView style={styles.bodyContainer}
innerRef={ref => {
this.scroll = ref
}}
contentContainerStyle={{ justifyContent: 'flex-end' }}>
<Background />
<Text style={styles.titleTop}>RECOVER ACCOUNT</Text>
Expand All @@ -95,6 +97,10 @@ class AccountRecoverView extends React.Component {
ENTER RECOVERY WORDS
</Text>
<AccountSeed
onFocus={(event)=> {
this.scroll.props.scrollToFocusedInput(findNodeHandle(event.target));
}}
ref={this._seed}
valid={validateSeed(selected.seed, selected.validBip39Seed).valid}
onChangeText={seed => {
this.debouncedAddressGeneration(seed);
Expand Down

0 comments on commit 10e97b4

Please sign in to comment.