Skip to content

Commit 11c5094

Browse files
fix(Form): fix vertical alignment of FormItems for labelSpan=12 (#5843)
1 parent 34d4a39 commit 11c5094

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/main/src/components/Form/Form.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
--_ui5wcr_form_label_text_align: end;
1212

13+
&.labelSpan12 {
14+
align-items: start;
15+
}
16+
1317
[data-component-name='FormGroupTitle'] {
1418
margin-inline: 1rem;
1519
}

packages/main/src/components/Form/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,11 @@ const Form = forwardRef<HTMLFormElement, FormPropTypes>((props, ref) => {
366366

367367
return { formItems, formGroups, registerItem, unregisterItem, rowsWithGroup };
368368
}, [items, registerItem, unregisterItem, currentNumberOfColumns, titleText, currentLabelSpan]);
369-
const formClassNames = clsx(classNames.form, classNames[backgroundDesign.toLowerCase()]);
369+
const formClassNames = clsx(
370+
classNames.form,
371+
classNames[backgroundDesign.toLowerCase()],
372+
currentLabelSpan == 12 && classNames.labelSpan12
373+
);
370374
const CustomTag = as as ElementType;
371375

372376
const prevFormItems = useRef<undefined | FormItemLayoutInfo[]>(undefined);

0 commit comments

Comments
 (0)