Skip to content

Commit

Permalink
fix(CheckboxGroup): fix intervalOptions not is Checkbox (#3253)
Browse files Browse the repository at this point in the history
Co-authored-by: Heising <[email protected]>
  • Loading branch information
HaixingOoO and Heising authored Dec 3, 2024
1 parent 8764780 commit e662341
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/checkbox/CheckboxGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ const CheckboxGroup = <T extends CheckboxGroupValue = CheckboxGroupValue>(props:
const intervalOptions =
Array.isArray(options) && options.length > 0
? options
: React.Children.map(children, (child) => (child as ReactElement)?.props || {}) || [];
: React.Children.map(
children,
(child: JSX.Element) => child.type.displayName === Checkbox.displayName && (child as ReactElement).props,
) || [];

const optionsWithoutCheckAll = intervalOptions.filter((t) => typeof t !== 'object' || !t.checkAll);
const optionsWithoutCheckAllValues = [];
Expand Down

0 comments on commit e662341

Please sign in to comment.