Skip to content

Commit 343efba

Browse files
authored
Merge branch 'main' into avoid-full-lodash-import
2 parents 6831b80 + bf579d5 commit 343efba

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [5.9.1](https://github.com/gravity-ui/dynamic-forms/compare/v5.9.0...v5.9.1) (2025-10-23)
4+
5+
6+
### Bug Fixes
7+
8+
* **utils:** imporve nullish-checking for number inputs ([#327](https://github.com/gravity-ui/dynamic-forms/issues/327)) ([537d5f6](https://github.com/gravity-ui/dynamic-forms/commit/537d5f68e6db46eb4cba165d58ad8d50c2d8ba9f))
9+
310
## [5.9.0](https://github.com/gravity-ui/dynamic-forms/compare/v5.8.1...v5.9.0) (2025-09-10)
411

512

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gravity-ui/dynamic-forms",
3-
"version": "5.9.0",
3+
"version": "5.9.1",
44
"description": "",
55
"license": "MIT",
66
"main": "build/cjs/index.js",

src/lib/core/components/Form/Controller/utils.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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};

0 commit comments

Comments
 (0)