Skip to content

[Form | form item | Label]: Form item label alignment issue when resize screen #11912

@jinnatan

Description

@jinnatan

Bug Description

I am getting alignment issue of the form items when migration from @ui5/webcomponents-react v1 to v2. As suggested by ui5 react componment colleague, i am opening a bug here.
https://openui5.slack.com/archives/CSQEJ2J04/p1752093146476959

The input fields are not in a row. This looks ugly.

Image

I tried to add the Label property with wrappingType="None" . When resize to smaller size, two form items overlapped.

Image

Affected Component

FormItem

Expected Behaviour

Labels should be aligned, input should be in one row

Image

Isolated Example

https://stackblitz.com/~/github.com/jinnatan/ui5-formitem-issue?view=editor

Steps to Reproduce

https://ui5formitemissue-ecof-9scbm0vc--5173--96435430.local-credentialless.webcontainer.io/
Resize the screen, you can see the input are not in one row

Log Output, Stack Trace or Screenshots

No response

Priority

None

UI5 Web Components Version

2.12.0

Browser

Chrome

Operating System

No response

Additional Context

Test code


import { Form, FormItem, Input, Label, Option, Select } from '@ui5/webcomponents-react';


function App() {

  return <Form
    labelSpan="S12 M12 L12 XL12"
    layout="S1 M4 L4 XL4"
  >
    <FormItem labelContent={<Label required>Number of Replicas</Label>}>
      <Input type="Text" />
    </FormItem>
    <FormItem labelContent={<Label required >Request/Limit CPU</Label>}>
      <Input type="Text" />
    </FormItem>
    <FormItem labelContent={<Label required > Maximum Java Memory (Gi)</Label>}>
      <Input type="Text" />
    </FormItem>
    <FormItem labelContent={<Label required >Memory Scale Factor</Label>}>
      <Select>
        <Option>
          1
        </Option>
        <Option>
          1.25
        </Option>
        <Option>
          1.5
        </Option>
      </Select>
    </FormItem>
  </Form>

}

export default App;

Organization

SAP

Declaration

  • I’m not disclosing any internal or sensitive information.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions