From c36156c18ae5affae225fa1b711264824ac88517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Thu, 19 Feb 2026 14:40:39 +0400 Subject: [PATCH] Disable all inputs with disabled form prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- apps/console/src/components/form/EmailsField.tsx | 6 +++++- .../iam/organizations/people/_components/PersonForm.tsx | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/console/src/components/form/EmailsField.tsx b/apps/console/src/components/form/EmailsField.tsx index 4942c20ad..deb93c48a 100644 --- a/apps/console/src/components/form/EmailsField.tsx +++ b/apps/console/src/components/form/EmailsField.tsx @@ -4,6 +4,7 @@ import type { ArrayPath, Control, FieldValue, FieldValues, Path, UseFormRegister import { useFieldArray } from "react-hook-form"; type Props = { + disabled: boolean; control: Control; register: UseFormRegister; }; @@ -13,7 +14,7 @@ type Props = { */ export function EmailsField< TFieldValues extends FieldValues = FieldValues, ->({ control, register }: Props) { +>({ control, register, disabled }: Props) { const { __ } = useTranslate(); const { fields, append, remove } = useFieldArray({ name: "additionalEmailAddresses" as ArrayPath, @@ -29,11 +30,13 @@ export function EmailsField< className="w-full" {...register(`additionalEmailAddresses.${index}` as Path)} type="email" + disabled={disabled} /> diff --git a/apps/console/src/pages/iam/organizations/people/_components/PersonForm.tsx b/apps/console/src/pages/iam/organizations/people/_components/PersonForm.tsx index 4ea84bdd5..f8f951d85 100644 --- a/apps/console/src/pages/iam/organizations/people/_components/PersonForm.tsx +++ b/apps/console/src/pages/iam/organizations/people/_components/PersonForm.tsx @@ -159,7 +159,7 @@ export function PersonForm(props: { return (
void handleSubmit(e)} className="space-y-4"> - + {id ? ( <> @@ -235,7 +235,7 @@ export function PersonForm(props: { placeholder={__("e.g. CEO, CFO, etc.")} disabled={disabled} /> - +