Skip to content

Commit 3a71c99

Browse files
committed
fix: improve checkbox selection logic to handle null or undefined values
1 parent b1419f8 commit 3a71c99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)