[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-typescript-core] 01/02: auto complete off, fix form focus
From: |
Admin |
Subject: |
[taler-typescript-core] 01/02: auto complete off, fix form focus |
Date: |
Tue, 04 Feb 2025 14:48:21 +0100 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository taler-typescript-core.
commit 15f551608ee2302ae5240f1104d8d1ba0564f141
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Tue Feb 4 10:47:12 2025 -0300
auto complete off, fix form focus
---
packages/web-util/src/forms/fields/InputLine.tsx | 6 ++++--
packages/web-util/src/forms/fields/InputSelectOne.tsx | 1 +
packages/web-util/src/forms/fields/InputText.stories.tsx | 6 ++++++
packages/web-util/src/forms/forms-ui.tsx | 2 +-
packages/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
index 578e4dc92..8ead18dbe 100644
--- 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
index 118e007c0..5ce1671ef 100644
--- 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
index d518bd9f2..903d7a3e9 100644
--- 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
index 9ca25393d..b281705d9 100644
--- 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
index 4f459aec2..80d0fc52f 100644
--- 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,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.