Skip to content

Commit

Permalink
fix: transform valid values for number and boolean HTML attributes (#648
Browse files Browse the repository at this point in the history
)

Co-authored-by: Jared Robertson <jared.robertson@securitymetrics.com>
  • Loading branch information
jyjor and jared-secmet committed Mar 25, 2024
1 parent 5fb201f commit ea4f4a4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/angular-form/src/tanstack-field.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
type OnChanges,
type OnDestroy,
type OnInit,
booleanAttribute,
numberAttribute,
} from '@angular/core'
import {
type DeepKeys,
Expand Down Expand Up @@ -44,9 +46,9 @@ export class TanStackField<
// This can be removed when TanStack Form Core is moved to TS min of 5.4
// and the NoInfer internal util type is rm-rf'd
@Input() defaultValue?: NoInferHack<TData>
@Input() asyncDebounceMs?: number
@Input() asyncAlways?: boolean
@Input() preserveValue?: boolean
@Input({ transform: numberAttribute }) asyncDebounceMs?: number
@Input({ transform: booleanAttribute }) asyncAlways?: boolean
@Input({ transform: booleanAttribute }) preserveValue?: boolean
@Input() validatorAdapter?: TFieldValidator
@Input({ required: true }) tanstackField!: FormApi<
TParentData,
Expand Down

0 comments on commit ea4f4a4

Please sign in to comment.