Skip to content

Commit

Permalink
Add checkboxDisabled prop to CollapsibleWithCheckbox (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertStigsson committed Sep 6, 2023
1 parent eb073bc commit d129672
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export interface CollapsibleWithCheckboxProps
Pick<
CheckboxProps,
"value" | "onValueChange" | "onChange" | "indeterminate"
> {}
> {
checkboxDisabled: boolean;
}

export const CollapsibleWithCheckbox: React.FC<
CollapsibleWithCheckboxProps
Expand All @@ -16,6 +18,7 @@ export const CollapsibleWithCheckbox: React.FC<
onValueChange,
onChange,
indeterminate,
checkboxDisabled,
...collapsibleProps
}) => {
return (
Expand All @@ -26,6 +29,7 @@ export const CollapsibleWithCheckbox: React.FC<
indeterminate={indeterminate}
onValueChange={onValueChange}
onChange={onChange}
disabled={checkboxDisabled}
onClick={(ev) => ev.stopPropagation()}
/>
}
Expand Down

0 comments on commit d129672

Please sign in to comment.