Skip to content

Commit

Permalink
fix: fixed focus on input click (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriocomo authored Dec 12, 2024
1 parent d9b642e commit e6cb384
Show file tree
Hide file tree
Showing 5 changed files with 933 additions and 748 deletions.
18 changes: 10 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"bootstrap-italia": "^2.8.8",
"copy-to-clipboard": "^3.3.3",
"countries-list": "^3.0.6",
"design-react-kit": "^5.0.4",
"design-react-kit": "^5.4.1",
"i18next": "^23.2.2",
"i18next-browser-languagedetector": "^7.2.0",
"js-yaml": "^4.1.0",
Expand Down Expand Up @@ -96,4 +96,4 @@
"typescript-eslint": "^8.11.0",
"vite": "^5.4.1"
}
}
}
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
Loading

0 comments on commit e6cb384

Please sign in to comment.