Skip to content

setInput cannot handle null/undefined values on nullish object fields #15

@Huliiiiii

Description

@Huliiiiii

Calling setInput to set a nullish object field to null or undefined will result in a runtime error.

That's because setFieldInput internally uses:

https://github.com/fabian-hiller/formisch/blob/5c6470a90cdc0c39f26eed42c2eca33eacd35990/packages/core/src/field/setFieldInput/setFieldInput.ts#L65-L72

However, the key is not in null and undefined, so an error will be thrown.

Additional Issue

The input type of nullish field is narrowed from T | null | undefined to T | null

Metadata

Metadata

Assignees

Labels

fixSmaller bug fix or improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions