Skip to content

Commit

Permalink
fix(setup-wallet): mnemonic input local/selected word inequality
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed May 9, 2024
1 parent 5787cf2 commit de77d6f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ const MnemonicWordInput = React.forwardRef<MnemonicWordInputRef, MnemonicWordInp
[onClearError, onError, onSubmitEditing, setSuggestedWords],
)

const onBlur = React.useCallback(() => {
if (word !== selectedWord) {
onSubmitEditing()
}
setSuggestedWords([])
}, [onSubmitEditing, selectedWord, setSuggestedWords, word])

return (
<TextInput
ref={inputRef}
Expand Down Expand Up @@ -299,7 +306,7 @@ const MnemonicWordInput = React.forwardRef<MnemonicWordInputRef, MnemonicWordInp
onKeyPress(word)
}
}}
onBlur={() => setSuggestedWords([])}
onBlur={onBlur}
keyboardType={Platform.OS === 'android' ? 'visible-password' : undefined} // to hide keyboard suggestions on android
/>
)
Expand Down

0 comments on commit de77d6f

Please sign in to comment.