Skip to content

Commit 1a34211

Browse files
Merge pull request #483 from devtron-labs/fix/rjsf-checkbox-null-check
fix: improve checkbox selection logic to handle null or undefined values
2 parents b1419f8 + 704f4b5 commit 1a34211

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

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": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.3.0-patch-2",
3+
"version": "1.3.0-patch-3",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/RJSF/widgets/Checkbox.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import React, { ChangeEvent } from 'react'
1818
import { WidgetProps } from '@rjsf/utils'
19+
import { isNullOrUndefined } from '@Shared/Helpers'
1920
import Toggle from '../../Toggle/Toggle'
2021

2122
export const Checkbox = ({
@@ -38,7 +39,7 @@ export const Checkbox = ({
3839
}
3940
}
4041

41-
const isSelected: boolean = typeof value === 'undefined' ? false : value
42+
const isSelected: boolean = isNullOrUndefined(value) ? false : value
4243

4344
return (
4445
<div>

0 commit comments

Comments
 (0)