Skip to content

Commit 08c640d

Browse files
Lukas742MarcusNotheis
authored andcommitted
fix(Form): correct alignment of FormItems (#1305)
1 parent ce805c8 commit 08c640d

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

packages/main/src/components/Form/Form.jss.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const labelSpanClasses = () => {
1414
const styles = {
1515
form: {
1616
display: 'grid',
17-
alignItems: 'center',
17+
alignItems: 'baseline',
1818
rowGap: '0.25rem',
1919
columnGap: '0.5rem',
2020
gridTemplateColumns: `repeat(12, 1fr)`,

packages/main/src/components/Form/Form.stories.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { CheckBox } from '@ui5/webcomponents-react/lib/CheckBox';
33
import { Form } from '@ui5/webcomponents-react/lib/Form';
44
import { FormGroup } from '@ui5/webcomponents-react/lib/FormGroup';
55
import { FormItem } from '@ui5/webcomponents-react/lib/FormItem';
6+
import { TextArea } from '@ui5/webcomponents-react/lib/TextArea';
67
import { Input } from '@ui5/webcomponents-react/lib/Input';
78
import { InputType } from '@ui5/webcomponents-react/lib/InputType';
89
import { Option } from '@ui5/webcomponents-react/lib/Option';
@@ -55,6 +56,9 @@ import { DocsHeader } from '@shared/stories/DocsHeader';
5556
<Option>Italy</Option>
5657
</Select>
5758
</FormItem>
59+
<FormItem label="Additional Comment">
60+
<TextArea rows={5} style={{ width: '210px' }} />
61+
</FormItem>
5862
<FormItem label={'Home address'}>
5963
<CheckBox checked />
6064
</FormItem>

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,11 @@ const useStyles = createUseStyles(
2929
label: {
3030
gridColumnEnd: 'span var(--ui5wcr_form_label_span)',
3131
justifySelf: 'var(--ui5wcr_form_label_text_align)',
32-
textAlign: 'var(--ui5wcr_form_label_text_align)',
33-
alignSelf: 'start',
34-
paddingTop: CssSizeVariables.sapWcrFormLabelPaddingTop,
35-
paddingBottom: '0.075rem'
32+
textAlign: 'var(--ui5wcr_form_label_text_align)'
3633
},
3734
content: {
38-
gridColumnEnd: 'span var(--ui5wcr_form_content_span)',
39-
alignSelf: 'end'
35+
display: 'flex',
36+
gridColumnEnd: 'span var(--ui5wcr_form_content_span)'
4037
}
4138
},
4239
{ name: 'FormItem' }

0 commit comments

Comments
 (0)