Skip to content

Commit ea4f4a4

Browse files
jyjorjared-secmet
andauthored
fix: transform valid values for number and boolean HTML attributes (#648)
Co-authored-by: Jared Robertson <jared.robertson@securitymetrics.com>
1 parent 5fb201f commit ea4f4a4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/angular-form/src/tanstack-field.directive.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import {
44
type OnChanges,
55
type OnDestroy,
66
type OnInit,
7+
booleanAttribute,
8+
numberAttribute,
79
} from '@angular/core'
810
import {
911
type DeepKeys,
@@ -44,9 +46,9 @@ export class TanStackField<
4446
// This can be removed when TanStack Form Core is moved to TS min of 5.4
4547
// and the NoInfer internal util type is rm-rf'd
4648
@Input() defaultValue?: NoInferHack<TData>
47-
@Input() asyncDebounceMs?: number
48-
@Input() asyncAlways?: boolean
49-
@Input() preserveValue?: boolean
49+
@Input({ transform: numberAttribute }) asyncDebounceMs?: number
50+
@Input({ transform: booleanAttribute }) asyncAlways?: boolean
51+
@Input({ transform: booleanAttribute }) preserveValue?: boolean
5052
@Input() validatorAdapter?: TFieldValidator
5153
@Input({ required: true }) tanstackField!: FormApi<
5254
TParentData,

0 commit comments

Comments
 (0)