Skip to content

Commit

Permalink
fix: make enter key submit form on import keys page (#653)
Browse files Browse the repository at this point in the history
The form contains two buttons and unless the type attribute is
explicitly set, the default behaviour is type="submit" which means
pressing the enter key clicks the first (and wrong) one.
  • Loading branch information
emccorson committed Mar 5, 2024
1 parent 11757a6 commit 0e4a5a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/extension/src/Setup/ImportAccount/SeedPhraseImport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export const SeedPhraseImport: React.FC<Props> = ({ onConfirm }) => {
data-testid="setup-import-keys-use-passphrase-button"
className="text-xs !text-neutral-400"
onClick={onShowPassphraseChange}
type="button" // makes enter key ignore this and submit form
>
Import with BIP39 Passphrase
</LinkButton>
Expand All @@ -271,6 +272,7 @@ export const SeedPhraseImport: React.FC<Props> = ({ onConfirm }) => {
size="lg"
data-testid="setup-import-keys-import-button"
disabled={isSubmitButtonDisabled}
type="submit"
>
Next
</ActionButton>
Expand Down

0 comments on commit 0e4a5a1

Please sign in to comment.