Skip to content

Commit

Permalink
fix(form-core): field transform function changes not being recognized
Browse files Browse the repository at this point in the history
  • Loading branch information
gutentag2012 committed May 27, 2024
1 parent fb2dd5c commit 09488cf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/form-core/src/FieldLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -957,19 +957,21 @@ export class FieldLogic<
return
}

const options = this._options.peek()
const options = this._options
const wrappedSignal = computed(() => {
if (!options?.transformToBinding) return undefined
return options.transformToBinding(unSignalifyValueSubscribed(this.data))
if (!options.value?.transformToBinding) return undefined
return options.value.transformToBinding(
unSignalifyValueSubscribed(this.data),
)
})

this._transformedData = {
get base() {
return baseSignal
},
set value(newValue: TBoundValue) {
if (!options?.transformFromBinding) return
const transformedValue = options.transformFromBinding(newValue)
if (!options.value?.transformFromBinding) return
const transformedValue = options.value.transformFromBinding(newValue)
baseSignal.value = deepSignalifyValue(transformedValue).value
},
get value() {
Expand Down

0 comments on commit 09488cf

Please sign in to comment.