From 0c6aeb1648544af877d15f01d1dd7d305f0411ea Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 19 Jul 2026 15:14:36 +0300 Subject: [PATCH] Add required to textarea label when relevantx --- app/form/fields.ts | 12 ++++++++++-- app/form/fields/TextareaFormField.tsx | 3 +++ app/form/types.ts | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/form/fields.ts b/app/form/fields.ts index ca2933772..34358e7f6 100644 --- a/app/form/fields.ts +++ b/app/form/fields.ts @@ -299,7 +299,10 @@ export function numberFieldOptional( export function textAreaOptional( args: WithTypedTranslationKeys< - Omit, "type" | "initialValue"> + Omit< + Extract, + "type" | "initialValue" | "required" + > >, ) { return safeNullableStringSchema({ max: args.maxLength }).register( @@ -308,6 +311,7 @@ export function textAreaOptional( ...args, label: prefixKey(args.label), bottomText: prefixKey(args.bottomText), + required: false, type: "text-area", initialValue: "", }, @@ -316,13 +320,17 @@ export function textAreaOptional( export function textAreaRequired( args: WithTypedTranslationKeys< - Omit, "type" | "initialValue"> + Omit< + Extract, + "type" | "initialValue" | "required" + > >, ) { return safeStringSchema({ max: args.maxLength }).register(formRegistry, { ...args, label: prefixKey(args.label), bottomText: prefixKey(args.bottomText), + required: true, type: "text-area", initialValue: "", }); diff --git a/app/form/fields/TextareaFormField.tsx b/app/form/fields/TextareaFormField.tsx index 790daaf75..fd9304605 100644 --- a/app/form/fields/TextareaFormField.tsx +++ b/app/form/fields/TextareaFormField.tsx @@ -16,6 +16,7 @@ export function TextareaFormField({ maxLength, error, onBlur, + required, disabled, value, onChange, @@ -27,6 +28,7 @@ export function TextareaFormField({ id={id} name={name} label={label} + required={required} error={error} bottomText={bottomText} valueLimits={ @@ -43,6 +45,7 @@ export function TextareaFormField({ id, bottomText, error, + required, })} /> diff --git a/app/form/types.ts b/app/form/types.ts index c86a01be3..b976da28c 100644 --- a/app/form/types.ts +++ b/app/form/types.ts @@ -43,6 +43,7 @@ interface FormFieldText extends FormFieldBase { interface FormFieldTextarea extends FormFieldBase { maxLength: number; + required: boolean; } interface FormFieldInGameName extends FormFieldBase {