Skip to content
Source
Sign inSign up
TanStack/form

fix(form-core): clear errorSourceMap.onMount alongside errorMap.onMount #2362

Openalliasgher(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/2362/headopened

Showing 3 changed files with 74 additions and 0 deletions.

x
0 of 3 viewed, 3 left
5 additions and 0 deletions.changeset/olive-forms-clear.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/form-core': patch
+---
+​
+Clear a field's `errorSourceMap.onMount` alongside `errorMap.onMount` when its value is set.
5 additions and 0 deletionspackages/form-core/src/FormApi.tsModified
View file
@@ -2668,6 +2668,11 @@
...prev?.errorMap,
onMount: undefined,
+ errorSourceMap: {
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+ ...prev?.errorSourceMap,
+ onMount: undefined,
+ },
64 additions and 0 deletionspackages/form-core/tests/FormApi.spec.tsModified
View file