diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index dc8ccae7d..d9435bfe5 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -596,7 +596,7 @@ } }, "justValidPreGeneratedMnemonic": { - "message": "Just valid pre-generated mnemonic" + "message": "Invalid Seed Phrase" }, "seedPasteFailedTooManyWords": { "message": "Paste failed because it contained over 24 words." diff --git a/public/_locales/en_GB/messages.json b/public/_locales/en_GB/messages.json index a9c1e9c8f..55e9decd0 100644 --- a/public/_locales/en_GB/messages.json +++ b/public/_locales/en_GB/messages.json @@ -480,7 +480,7 @@ "message": "Each word separated with a single space" }, "justValidPreGeneratedMnemonic": { - "message": "Just valid pre-generated mnemonic" + "message": "Invalid Seed Phrase" }, "oops": { "message": "Oops!" diff --git a/src/app/pages/NewWallet/import/ImportSeedPhrase/ImportFromSeedPhrase.tsx b/src/app/pages/NewWallet/import/ImportSeedPhrase/ImportFromSeedPhrase.tsx index 0d0c7e0f8..b0e2497ec 100644 --- a/src/app/pages/NewWallet/import/ImportSeedPhrase/ImportFromSeedPhrase.tsx +++ b/src/app/pages/NewWallet/import/ImportSeedPhrase/ImportFromSeedPhrase.tsx @@ -46,7 +46,7 @@ export const ImportFromSeedPhrase: FC = ({ setNumberOfWords={setNumberOfWords} /> - + diff --git a/src/app/templates/SeedPhraseInput/SeedWordInput.tsx b/src/app/templates/SeedPhraseInput/SeedWordInput.tsx index f873dfadc..aa430d1dd 100644 --- a/src/app/templates/SeedPhraseInput/SeedWordInput.tsx +++ b/src/app/templates/SeedPhraseInput/SeedWordInput.tsx @@ -19,6 +19,8 @@ export interface SeedWordInputProps extends TestIDProperty { onSeedWordChange: (index: number, value: string) => void; } +const BUTTON_TAG_NAME = 'BUTTON'; + export const SeedWordInput: FC = ({ id, submitted, @@ -48,7 +50,7 @@ export const SeedWordInput: FC = ({ ); useEffect(() => { - if (value && !bip39WordList.includes(value) && isBlur) { + if (value && !bip39WordList.includes(value)) { setWordSpellingError(t('mnemonicWordsError')); errorCheckRef.current = true; } else { @@ -66,7 +68,7 @@ export const SeedWordInput: FC = ({ }, [showAutocomplete, value, isBlur]); const autocompleteVariants = useMemo( - () => (value ? bip39WordList.filter(word => word.startsWith(value)) : null), + () => (value ? bip39WordList.filter(word => word.startsWith(value)).slice(0, 3) : null), [value] ); @@ -81,14 +83,14 @@ export const SeedWordInput: FC = ({ }; const handleBlur = (e: React.FocusEvent) => { - if (e.relatedTarget === null) { + if (e.relatedTarget?.tagName !== BUTTON_TAG_NAME) { setIsBlur(true); } }; return (
-
); };