From d8b278ca415440fbb1c12ca40460acc528b1beb4 Mon Sep 17 00:00:00 2001 From: rohanm-crest Date: Wed, 18 Dec 2024 22:59:20 +0530 Subject: [PATCH] fix: resolve issue for disable in group checkbox --- ui/src/components/CheckboxTree/CheckboxTree.tsx | 6 ++++++ ui/src/components/CheckboxTree/StyledComponent.tsx | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/components/CheckboxTree/CheckboxTree.tsx b/ui/src/components/CheckboxTree/CheckboxTree.tsx index a84d85868..cb7c378f1 100644 --- a/ui/src/components/CheckboxTree/CheckboxTree.tsx +++ b/ui/src/components/CheckboxTree/CheckboxTree.tsx @@ -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'); diff --git a/ui/src/components/CheckboxTree/StyledComponent.tsx b/ui/src/components/CheckboxTree/StyledComponent.tsx index 35abe193e..3734d9fc6 100644 --- a/ui/src/components/CheckboxTree/StyledComponent.tsx +++ b/ui/src/components/CheckboxTree/StyledComponent.tsx @@ -35,7 +35,6 @@ export const StyledCollapsiblePanel = styled(CollapsiblePanel)` })}; display: flex; align-items: center; - align-content: center; // for prisma styling & > span { align-content: center; @@ -118,7 +117,6 @@ export const CustomCheckbox = styled.input.attrs({ type: 'checkbox' })` enterprise: variables.backgroundColor, prisma: variables.focusColor, })}; - border: none; } &:checked::after {