Skip to content

Commit

Permalink
Merge pull request #271 from near/SQAC-138/click-enter-to-connect-ledger
Browse files Browse the repository at this point in the history
chore: Connect To Ledger by Pressinng Enter
  • Loading branch information
kujtimprenkuSQA authored Apr 22, 2022
2 parents 1d8c7b8 + 0cc51e9 commit 87466d8
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export const LedgerDerivationPath: React.FC<LedgerDerivationPathProps> = ({
}
};

const handleEnterClick = async (e: unknown) => {
if ((e as KeyboardEvent).key === "Enter") {
await handleConnectClick();
}
};

return (
<div className="Modal-body Modal-choose-ledger-derivation-path">
<p>
Expand All @@ -66,6 +72,7 @@ export const LedgerDerivationPath: React.FC<LedgerDerivationPathProps> = ({
value={ledgerDerivationPath}
onChange={handleDerivationPathChange}
readOnly={isLoading}
onKeyPress={handleEnterClick}
/>
{ledgerError && <p className="error">{ledgerError}</p>}
</div>
Expand Down

0 comments on commit 87466d8

Please sign in to comment.