File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/lib/core/components/Form/Controller Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -239,7 +239,7 @@ export const getFieldInitials = <
239239 }
240240
241241 if ( isNil ( value ) ) {
242- if ( spec . defaultValue ) {
242+ if ( ! isNil ( spec . defaultValue ) ) {
243243 value = transformArrIn ( spec . defaultValue ) as DirtyValue ;
244244 }
245245 // if the spec with type array or object, and this spec has "required === true",
@@ -298,7 +298,7 @@ export const getFieldMethods = <
298298 let value = transformArrIn ( _value ) ;
299299
300300 if ( isNumberSpec ( spec ) && ! error ) {
301- value = ( value ? Number ( value ) : undefined ) as DirtyValue ;
301+ value = ( isNil ( value ) || value === '' ? undefined : Number ( value ) ) as DirtyValue ;
302302 }
303303
304304 let newChildErrors : Record < string , ValidateError > = { ...state . childErrors } ;
You can’t perform that action at this time.
0 commit comments