Skip to content

Commit

Permalink
fix: focus on input fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriocomo committed Dec 12, 2024
1 parent 5ef6c3a commit 46c5d1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/app/components/EditorDescriptionInput.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Input, TextArea } from "design-react-kit";
import { get } from "lodash";
import {
FieldPathByValue,
useController,
useFormContext,
} from "react-hook-form";
import { useTranslation } from "react-i18next";
import PublicCode, { Description } from "../contents/publiccode";
import { get } from "lodash";
import { displayName } from "../../i18n";
import { Input, TextArea } from "design-react-kit";
import { RequiredDeep } from "type-fest";
import { displayName } from "../../i18n";
import PublicCode, { Description } from "../contents/publiccode";

type Props<T> = {
fieldName: T;
Expand Down Expand Up @@ -47,6 +47,7 @@ export default function EditorInput<
value={(value as string) || ""}
innerRef={ref}
label={`${label}${extraLangInfo}${required ? " *" : ""}${deprecated ? ` - ${t(`editor.form.deprecatedField`)}` : ""}`}
placeholder={label}
infoText={description}
valid={get(errors, `description.${lang}.${fieldName}`) && false}
validationText={get(errors, `description.${lang}.${fieldName}.message`)}
Expand Down
7 changes: 4 additions & 3 deletions src/app/components/EditorInput.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Input, TextArea } from "design-react-kit";
import { get } from "lodash";
import {
FieldPathByValue,
useController,
useFormContext,
} from "react-hook-form";
import { useTranslation } from "react-i18next";
import PublicCode, { PublicCodeWithDeprecatedFields } from "../contents/publiccode";
import { get } from "lodash";
import { Input, TextArea } from "design-react-kit";
import { RequiredDeep } from "type-fest";
import PublicCode, { PublicCodeWithDeprecatedFields } from "../contents/publiccode";

type Props<T> = {
fieldName: T;
Expand Down Expand Up @@ -44,6 +44,7 @@ export default function EditorInput<
value={value || ""}
innerRef={ref}
label={`${label}${required ? " *" : ""}${deprecated ? ` - ${t(`editor.form.deprecatedField`)}` : ""}`}
placeholder={label}
infoText={description}
valid={get(errors, fieldName) && false}
validationText={get(errors, `${fieldName}.message`)}
Expand Down

0 comments on commit 46c5d1b

Please sign in to comment.