Skip to content

Commit

Permalink
fix(extension): signData component no longer crash when enter is pres…
Browse files Browse the repository at this point in the history
…sed on password input (#1460)
  • Loading branch information
AngelCastilloB authored Oct 4, 2024
1 parent 38d01f3 commit 14a7d53
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ export const SignData = (): React.ReactElement => {
return !password;
}, [request, password]);

const handleSubmit = useCallback(
(event) => {
event.preventDefault();
event.stopPropagation();

if (!confirmIsDisabled) {
onConfirm();
}
},
[onConfirm, confirmIsDisabled]
);

return (
<Layout title={undefined}>
<div className={styles.passwordContainer}>
Expand All @@ -57,6 +69,7 @@ export const SignData = (): React.ReactElement => {
</h5>
<Password
onChange={handleChange}
onSubmit={handleSubmit}
error={validPassword === false}
errorMessage={t('browserView.transaction.send.error.invalidPassword')}
/>
Expand Down

0 comments on commit 14a7d53

Please sign in to comment.