Skip to content

Commit

Permalink
fix: remove form param submission bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tlebon committed Nov 9, 2023
1 parent 0c84609 commit 73818a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/script/auth/component/JoinGuestLinkPasswordModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const JoinGuestLinkPasswordModal: React.FC<JoinGuestLinkPasswordModalProps> = ({
const {formatMessage: _} = useIntl();
const [passwordValue, setPasswordValue] = useState<string>('');

const onSubmit = () => {
const onSubmit = (event: React.FormEvent<HTMLFormElement | HTMLButtonElement>) => {
event.preventDefault();
onSubmitPassword(passwordValue);
};

Expand All @@ -70,7 +71,7 @@ const JoinGuestLinkPasswordModal: React.FC<JoinGuestLinkPasswordModalProps> = ({
<Form
name="guest-password-join-form"
data-uie-name="guest-password-join-form"
onSubmit={onSubmit}
onSubmit={(event: React.FormEvent<HTMLFormElement>) => onSubmit(event)}
autoComplete="off"
>
<Input
Expand Down Expand Up @@ -98,7 +99,7 @@ const JoinGuestLinkPasswordModal: React.FC<JoinGuestLinkPasswordModalProps> = ({
block
type="button"
disabled={!passwordValue}
onClick={onSubmit}
onClick={(event: React.FormEvent<HTMLButtonElement>) => onSubmit(event)}
data-uie-name="guest-link-join-submit-button"
>
{_(joinGuestLinkPasswordModalStrings.joinConversation)}
Expand Down

0 comments on commit 73818a4

Please sign in to comment.