SAP / ui5-webcomponents-react

A wrapper implementation for React of the UI5 Web Components that are compliant with the SAP Fiori User Experience
https://sap.github.io/ui5-webcomponents-react/
Apache License 2.0
442 stars 99 forks source link

[Toolbar][Buttons]: Rendering differences compared with UI5 (default button, transparent/light button) #4737

Closed mhchem closed 1 year ago

mhchem commented 1 year ago

Describe the bug

Rendering of button inside a toolbar differs between (JavaScript) UI5 and UI5 web components for react.

Isolated Example

No response

Reproduction steps

In (JavaScript) UI5, when I put a default button into a toolbar, it renders as a transparent/light button ("transparent button" = UI5 terminology, "light button" = design terminology). See https://sapui5.hana.ondemand.com/#/entity/sap.m.Toolbar/sample/sap.m.sample.ToolbarResponsive

In UI5 web components for react, default buttons render with a gray background. See https://sap.github.io/ui5-webcomponents-react/?path=/docs/layouts-floorplans-toolbar--docs

Expected Behaviour

Both UI5 technologies should follow the same theme.

Screenshots or Videos

https://sapui5.hana.ondemand.com/#/entity/sap.m.Toolbar/sample/sap.m.sample.ToolbarResponsive

Screenshot 2023-06-13 at 17 00 17

https://sap.github.io/ui5-webcomponents-react/?path=/docs/layouts-floorplans-toolbar--docs

Screenshot 2023-06-13 at 17 00 29

UI5 Web Components for React Version

latest

UI5 Web Components Version

latest

Browser

Chrome

Operating System

No response

Additional Context

No response

Relevant log output

No response

Declaration

Lukas742 commented 1 year ago

Hi @mhchem

in React, unlike as it is with SAP or OpenUI5, the Button doesn't "know" that it is displayed inside a toolbar, nor does the toolbar "know" that it has Buttons as children. Implementing this behavior would lead to overhead and also to discrepancies in between other components like the Bar where the same behavior can also be observed in SAPUI5 but not with ui5-webcomponents. Please keep in mind that the Toolbar is a standalone React component, whereas the Button is a web component developed by the ui5-webcomponents team. If this behavior should be available, I think it should be implemented in the Bar (also a web-component) first and only then we would adjust our Toolbar to these specs.

If you feel like this feature is something that developers could benefit from, please raise an issue about the Bar in the ui5-webcomponents repo. However, in my opinion, this would cause more confusion than it would help in React and standard JS web development as there it's not the common behavior of components.

The linked PR will replace all standard buttons, with transparent buttons so it's more clear to developers what button should be used.