mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-29 03:13:19 -05:00
fix: fixes form submission (#2492)
This commit is contained in:
@@ -183,24 +183,31 @@ export const SignupForm = ({
|
||||
<IsPasswordValid password={password} setIsValid={setIsValid} />
|
||||
</div>
|
||||
)}
|
||||
<Button
|
||||
onClick={(e: any) => {
|
||||
e.preventDefault();
|
||||
if (!showLogin) {
|
||||
{showLogin && (
|
||||
<Button
|
||||
type="submit"
|
||||
variant="darkCTA"
|
||||
className="w-full justify-center"
|
||||
loading={signingUp}
|
||||
disabled={formRef.current ? !isButtonEnabled || !isValid : !isButtonEnabled}>
|
||||
Continue with Email
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{!showLogin && (
|
||||
<Button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setShowLogin(true);
|
||||
setButtonEnabled(false);
|
||||
// Add a slight delay before focusing the input field to ensure it's visible
|
||||
setTimeout(() => nameRef.current?.focus(), 100);
|
||||
} else if (formRef.current) {
|
||||
formRef.current.requestSubmit();
|
||||
}
|
||||
}}
|
||||
variant="darkCTA"
|
||||
className="w-full justify-center"
|
||||
loading={signingUp}
|
||||
disabled={formRef.current ? !isButtonEnabled || !isValid : !isButtonEnabled}>
|
||||
Continue with Email
|
||||
</Button>
|
||||
}}
|
||||
variant="darkCTA"
|
||||
className="w-full justify-center">
|
||||
Continue with Email
|
||||
</Button>
|
||||
)}
|
||||
</form>
|
||||
)}
|
||||
{googleOAuthEnabled && (
|
||||
|
||||
Reference in New Issue
Block a user