taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 15f551608ee2302ae5240f1104d8d1ba0564f141
parent 81b8e221700595a28c3d632f354aa30749d2d08a
Author: Sebastian <sebasjm@gmail.com>
Date:   Tue,  4 Feb 2025 10:47:12 -0300

auto complete off, fix form focus

Diffstat:
Mpackages/web-util/src/forms/fields/InputLine.tsx | 6++++--
Mpackages/web-util/src/forms/fields/InputSelectOne.tsx | 1+
Mpackages/web-util/src/forms/fields/InputText.stories.tsx | 6++++++
Mpackages/web-util/src/forms/forms-ui.tsx | 2+-
Mpackages/web-util/src/forms/gana/GLS_Onboarding.ts | 5+++--
5 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/packages/web-util/src/forms/fields/InputLine.tsx b/packages/web-util/src/forms/fields/InputLine.tsx @@ -232,7 +232,8 @@ export function InputLine<T extends object, K extends keyof T>( > <textarea rows={4} - ref={composeRef(saveRef(input), doAutoFocus)} + ref={composeRef(saveRef(input))} + // ref={composeRef(saveRef(input), doAutoFocus)} FIXME: enable autofocus when form has focus name={String(name)} onChange={(e) => { onChange(fromString(e.currentTarget.value)); @@ -258,7 +259,8 @@ export function InputLine<T extends object, K extends keyof T>( > <input name={String(name)} - ref={composeRef(saveRef(input), doAutoFocus)} + ref={composeRef(saveRef(input))} + // ref={composeRef(saveRef(input), doAutoFocus)} FIXME: enable autofocus when form has focus type={type} onChange={(e) => { onChange(fromString(e.currentTarget.value)); diff --git a/packages/web-util/src/forms/fields/InputSelectOne.tsx b/packages/web-util/src/forms/fields/InputSelectOne.tsx @@ -61,6 +61,7 @@ export function InputSelectOne<T extends object, K extends keyof T>( <div class="relative mt-2"> <input id="combobox" + autocomplete="off" type="text" value={filter ?? ""} onChange={(e) => { diff --git a/packages/web-util/src/forms/fields/InputText.stories.tsx b/packages/web-util/src/forms/fields/InputText.stories.tsx @@ -53,6 +53,12 @@ const design: FormDesign = { id: "comment" as UIHandlerId, required: true, }, + { + type: "text", + label: "label of the field" as TranslatedString, + id: "comment2" as UIHandlerId, + required: true, + }, ], }, ], diff --git a/packages/web-util/src/forms/forms-ui.tsx b/packages/web-util/src/forms/forms-ui.tsx @@ -155,7 +155,7 @@ export function RenderAllFieldsByUiConfig({ const Component = UIFormConfiguration[ field.type ] as FieldComponentFunction<any>; - const p = { ...field.properties, focus: focus }; + const p = { ...field.properties, focus: !!focus && i === 0 }; return Component(p); }), ); diff --git a/packages/web-util/src/forms/gana/GLS_Onboarding.ts b/packages/web-util/src/forms/gana/GLS_Onboarding.ts @@ -13,8 +13,8 @@ export function GLS_Onboarding( type: "double-column", sections: [ { - title: i18n.str`Personal individual information`, - description: i18n.str`Contact information of the company representative`, + title: i18n.str`Contact information of the company representative`, + // description: i18n.str``, fields: [ { id: "PERSON_FULL_NAME" satisfies keyof TalerFormAttributes.GLS_Onboarding as UIHandlerId, @@ -22,6 +22,7 @@ export function GLS_Onboarding( help: i18n.str`As on your ID document`, // gana_type: "String", type: "text", + required: true, }, { id: "PERSON_LAST_NAME" satisfies keyof TalerFormAttributes.GLS_Onboarding as UIHandlerId,