Skip to content

Commit 8fbe4fa

Browse files
fix(extension): signTransaction component no longer crash when enter is pressed on password input (#1402)
1 parent 24991ce commit 8fbe4fa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

apps/browser-extension-wallet/src/features/dapp/components/SignTransaction.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ export const SignTransaction = (): React.ReactElement => {
6565
setPreviousView();
6666
};
6767

68+
const handleSubmit = useCallback(
69+
(event) => {
70+
event.preventDefault();
71+
event.stopPropagation();
72+
73+
if (!confirmIsDisabled) {
74+
onConfirm();
75+
}
76+
},
77+
[onConfirm, confirmIsDisabled]
78+
);
79+
6880
return (
6981
<Layout title={undefined}>
7082
<div className={styles.passwordContainer}>
@@ -74,6 +86,7 @@ export const SignTransaction = (): React.ReactElement => {
7486
</h5>
7587
<Password
7688
onChange={handleChange}
89+
onSubmit={handleSubmit}
7790
error={validPassword === false}
7891
errorMessage={t('browserView.transaction.send.error.invalidPassword')}
7992
autoFocus

0 commit comments

Comments
 (0)