fix: checkbox-group widget breaking UI issue (#14820)

- Hides Style alignment when Inline option is false which fixes UI overlapping issues
- Resizing the widget other options which are outside don't come within the widget boundaries - Fixed
- Behaviour of widget when placed at top of the canvas - Fixed
This commit is contained in:
Bhavin K 2022-06-30 11:12:45 +05:30 committed by GitHub
parent 63e2240eed
commit 6686b94280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View File

@ -69,6 +69,15 @@ export interface CheckboxGroupContainerProps {
export const CheckboxGroupContainer = styled.div<CheckboxGroupContainerProps>`
${labelLayoutStyles}
justify-content: ${({ compactMode, labelPosition }) => {
if (
labelPosition &&
labelPosition !== LabelPosition.Left &&
!compactMode
) {
return "flex-start";
}
}};
& .${LABEL_CONTAINER_CLASS} {
${({ labelPosition }) =>
labelPosition === LabelPosition.Left && "min-height: 30px"};

View File

@ -165,9 +165,29 @@ class CheckboxGroupWidget extends BaseWidget<
isJSConvertible: true,
isBindProperty: true,
isTriggerProperty: false,
updateHook: (
props: CheckboxGroupWidgetProps,
propertyPath: string,
propertyValue: string,
) => {
const propertiesToUpdate = [{ propertyPath, propertyValue }];
const isOffInline =
typeof propertyValue === "string"
? !(propertyValue === "true")
: !propertyValue;
if (isOffInline) {
propertiesToUpdate.push({
propertyPath: "optionAlignment",
propertyValue: CheckboxGroupAlignmentTypes.NONE,
});
}
return propertiesToUpdate;
},
validation: {
type: ValidationTypes.BOOLEAN,
},
dependencies: ["isInline"],
},
{
propertyName: "isSelectAll",
@ -315,6 +335,12 @@ class CheckboxGroupWidget extends BaseWidget<
],
},
},
hidden: (props: CheckboxGroupWidgetProps) => {
return typeof props.isInline === "string"
? !(props.isInline === "true")
: !props.isInline;
},
dependencies: ["isInline"],
},
{
propertyName: "labelTextColor",