Skip to content

Commit 61f342e

Browse files
committed
fix: use deepEqual in rjsf select widget
1 parent 4d9246b commit 61f342e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Common/RJSF/widgets/Select.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { PLACEHOLDERS } from '../constants'
2121
import { getCommonSelectStyle } from '../utils'
2222

2323
import { ReactComponent as ArrowDown } from '../../../Assets/Icon/ic-chevron-down.svg'
24+
import { deepEqual } from '@Common/Helper'
2425

2526
const commonStyles = getCommonSelectStyle()
2627

@@ -57,8 +58,8 @@ export const Select = (props: WidgetProps) => {
5758

5859
const getOption = (value) =>
5960
multiple
60-
? selectOptions.filter((option) => value.some((val) => val === option.value))
61-
: selectOptions.find((option) => value === option.value)
61+
? selectOptions.filter((option) => value.some((val) => deepEqual(val, option.value)))
62+
: selectOptions.find((option) => deepEqual(value, option.value))
6263

6364
return (
6465
<ReactSelect

0 commit comments

Comments
 (0)