SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.56k stars 267 forks source link

[Form]: Label of field always on top when setting another theme #9788

Closed langered closed 2 months ago

langered commented 2 months ago

Describe the bug

When changing the theme (e.g. sap_horizon_dark) the label will always be displayed on top of its assosiated field. It seems that it is not respecting the labelSpan configuration. The documentation says, that if 12 is configured, the label is displayed above the field. For this example, I configured the size S to 4 to make sure it should never be the case.

When not changing the theme at all, everything works as expected.

Isolated Example

https://stackblitz.com/edit/github-mezoel?file=src%2FApp.tsx

Reproduction steps

  1. Start the stackblitz examle
  2. Look at the Form
  3. Remove the line where the theme is set
  4. See that everything works as expected

Expected Behaviour

Screenshots or Videos

When theme is changed to sap_horizon_dark, the label is above the field:

image

When no setTheme is executed, the form layout is correct and the label is next to the field:

image

UI5 Web Components for React Version

2.0.2

UI5 Web Components Version

2.1.2

Browser

Chrome, Safari

Operating System

No response

Additional Context

No response

Relevant log output

No response

Organization

No response

Declaration

Lukas742 commented 2 months ago

Hi @langered

Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.


Hi Colleagues,

here you can find an example using ui5wc without React or our wrapper: https://stackblitz.com/edit/github-wfshau-ulqg1d?file=index.html,main.js,package.json

Click on the button to change the theme and see the bug.

kskondov commented 2 months ago

Hello @SAP/ui5-webcomponents-topic-core,

This issue is reproducible when changing themes labelSpan property is ignored and labels positions in the form component is changed.

Best Regards, Konstantin

ilhan007 commented 2 months ago

Hello @langered thanks for reporting, fix has been prepared.