commit 9a2cfef15cd3989eaac0691b3a0d3915efa3392d
parent c24aaa1d422580fbe4481a1b2fdfa4c77c81013c
Author: Sebastian <sebasjm@gmail.com>
Date: Wed, 26 Mar 2025 18:22:09 -0300
fix recursivePartial
Diffstat:
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/packages/web-util/src/forms/fields/InputFile.tsx b/packages/web-util/src/forms/fields/InputFile.tsx
@@ -34,7 +34,7 @@ export function InputFile(
mimeType?: string,
filename?: string,
) => {
- console.log(`handleFile`, contentsBase64, mimeType, filename);
+ // console.log(`handleFile`, contentsBase64, mimeType, filename);
if (contentsBase64 == null) {
setDataUri(undefined);
onChange(undefined);
diff --git a/packages/web-util/src/forms/fields/InputSelectMultiple.stories.tsx b/packages/web-util/src/forms/fields/InputSelectMultiple.stories.tsx
@@ -21,8 +21,8 @@
import { TranslatedString } from "@gnu-taler/taler-util";
import * as tests from "../../tests/hook.js";
+import { FormDesign } from "../forms-types.js";
import { DefaultForm as TestedComponent } from "../forms-ui.js";
-import { FormDesign, UIHandlerId } from "../forms-types.js";
export default {
title: "Input Select Multiple",
@@ -100,3 +100,9 @@ export const SimpleComment = tests.createExample(TestedComponent, {
initial,
design,
});
+export const WithInitialValue = tests.createExample(TestedComponent, {
+ initial: {
+ pets:["one"]
+ },
+ design,
+});
diff --git a/packages/web-util/src/hooks/useForm.ts b/packages/web-util/src/hooks/useForm.ts
@@ -89,10 +89,12 @@ export type RecursivePartial<T> = {
[k in keyof T]?: T[k] extends string
? string
: T[k] extends AmountJson
- ? AmountJson
- : T[k] extends TalerExchangeApi.AmlState
- ? TalerExchangeApi.AmlState
- : RecursivePartial<T[k]>;
+ ? T[k]
+ : T[k] extends Array<any>
+ ? T[k]
+ : T[k] extends TalerExchangeApi.AmlState
+ ? T[k]
+ : RecursivePartial<T[k]>;
};
export type ErrorAndLabel = {