Skip to content

Commit

Permalink
fix: resolve issue for disable in group checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanm-crest committed Dec 18, 2024
1 parent 7666043 commit d8b278c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ui/src/components/CheckboxTree/CheckboxTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ function CheckboxTree(props: CheckboxTreeProps) {
setValues((prevValues) => {
const updatedValues = new Map(prevValues);
group.fields.forEach((item) => {
const findFieldInRow = controlOptions?.rows?.find(
(rowItem) => rowItem.field === item
);
if (findFieldInRow?.checkbox?.disabled === true) {
return;
}
updatedValues.set(item, { checkbox: newCheckboxValue });
});
handleChange(field, packValue(updatedValues), 'checkboxTree');
Expand Down
2 changes: 0 additions & 2 deletions ui/src/components/CheckboxTree/StyledComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const StyledCollapsiblePanel = styled(CollapsiblePanel)`
})};
display: flex;
align-items: center;
align-content: center;
// for prisma styling
& > span {
align-content: center;
Expand Down Expand Up @@ -118,7 +117,6 @@ export const CustomCheckbox = styled.input.attrs({ type: 'checkbox' })`
enterprise: variables.backgroundColor,
prisma: variables.focusColor,
})};
border: none;
}
&:checked::after {
Expand Down

0 comments on commit d8b278c

Please sign in to comment.