From 204a8a5755814cb62b626f68e687de4faf8ad296 Mon Sep 17 00:00:00 2001 From: Martin Adamko Date: Mon, 9 Oct 2023 14:50:19 +0200 Subject: [PATCH] fix(ui): Restrict setting style to positions on left and right --- .../components/Forms/FieldContainer/FieldContainer.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/components/Forms/FieldContainer/FieldContainer.tsx b/packages/ui/src/components/Forms/FieldContainer/FieldContainer.tsx index 72cafcb735..78337a01c1 100644 --- a/packages/ui/src/components/Forms/FieldContainer/FieldContainer.tsx +++ b/packages/ui/src/components/Forms/FieldContainer/FieldContainer.tsx @@ -218,10 +218,12 @@ export const FieldContainer = memo( colorSchemeClassName(useColorScheme()), classNameProp, ])} - style={useMemo(() => ({ - '--cui-field-container--body-content-height': px(height), - ...style, - }), [height, style])} + style={useMemo(() => labelPosition === 'left' || labelPosition === 'right' + ? ({ + '--cui-field-container--body-content-height': px(height), + ...style, + }) + : style, [height, labelPosition, style])} > {(label || labelDescription) && (