bbovenzi commented on code in PR #48409:
URL: https://github.com/apache/airflow/pull/48409#discussion_r2014642114
##########
airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/src/login/LoginForm.tsx:
##########
@@ -18,50 +18,62 @@
*/
import React from "react";
-import {Button, Field, Input, Stack} from "@chakra-ui/react";
-import {Controller, useForm} from "react-hook-form";
-import {LoginBody} from "./Login";
+import { Button, Field, Input, Stack } from "@chakra-ui/react";
+import { Controller, useForm } from "react-hook-form";
+import { LoginBody } from "./Login";
type LoginFormProps = {
- readonly onLogin: (loginBody: LoginBody) => string;
- readonly isPending: boolean;
+ readonly onLogin: (loginBody: LoginBody) => string;
+ readonly isPending: boolean;
};
export const LoginForm = ({ onLogin, isPending }: LoginFormProps) => {
- const {
- control, handleSubmit,
- formState: { isValid },
- } = useForm<LoginBody>({
- defaultValues: {
- username: "", password: "",
- },
- });
+ const {
+ control,
+ handleSubmit,
+ formState: { isValid },
+ } = useForm<LoginBody>({
+ defaultValues: {
+ username: "",
+ password: "",
+ },
+ });
- return <Stack spacing={4}>
+ return (
+ <form onSubmit={() => void handleSubmit(onLogin)()}>
+ <Stack gap={4}>
Review Comment:
Here are the actual changes. Moving `handleSubmit` from the button's onclick
to here while adding `type="submit"` to the button.
Also, chakra changed `spacing` to `gap`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]