Skip to content

Commit 14a7d53

Browse files
fix(extension): signData component no longer crash when enter is pressed on password input (#1460)
1 parent 38d01f3 commit 14a7d53

File tree

1 file changed

+13
-0
lines changed
  • apps/browser-extension-wallet/src/features/dapp/components

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ export const SignData = (): React.ReactElement => {
4848
return !password;
4949
}, [request, password]);
5050

51+
const handleSubmit = useCallback(
52+
(event) => {
53+
event.preventDefault();
54+
event.stopPropagation();
55+
56+
if (!confirmIsDisabled) {
57+
onConfirm();
58+
}
59+
},
60+
[onConfirm, confirmIsDisabled]
61+
);
62+
5163
return (
5264
<Layout title={undefined}>
5365
<div className={styles.passwordContainer}>
@@ -57,6 +69,7 @@ export const SignData = (): React.ReactElement => {
5769
</h5>
5870
<Password
5971
onChange={handleChange}
72+
onSubmit={handleSubmit}
6073
error={validPassword === false}
6174
errorMessage={t('browserView.transaction.send.error.invalidPassword')}
6275
/>

0 commit comments

Comments
 (0)