sap.m.Flexbox resize not working
OpenUI5 version:
1.38.38, 1.56.10, probably can be reproduced in any version
Browser/version (+device/version):
Google Chrome Version 69.0.3497.100 (Offizieller Build) (64-Bit)
Any other tested browsers/devices(OK/FAIL):
Firefox 62.0.3 (64-Bit) - also failed
URL (minimal example if possible):
https://jsfiddle.net/sc984pum/10/
Steps to reproduce the problem:
- Execute jsfiddle
- Shrink the output pane (or the browse window) so it is not possible to show both buttons fully
What is the expected result?
Button1 should shrink according to the flexbox CSS rules Expected behavior shown here (note the added CSS): https://jsfiddle.net/sc984pum/8/
What happens instead?
Button2 starts to disappear
Any other information? (attach screenshot if possible)
If you look at the DOM that is actually rendered (using browser's dev tools), there is the FlexBox, a DIV (with CSS class sapMFlexItem) and the Button. This DIV is causing the malfunction. If the width of 400px is set to the div instead of the button the whole thing becomes responsive. (Additionally change the button's width to 100%, to have a clean final result) -> see expected behavior link.
Unfortunately this DIV is not in any UI5 context, so it is hard to change the behavior in JS. Going by CSS class sapMFlexItem, also causes weird behavior.
This also occurs in classes that extend FlexBox (HBox is what i tested).
Hello @ANMichael ,
Thank you for sharing this finding. I've created an internal incident 1880633489. The status of the issue will be updated here in GitHub.
Regards, Elena
@ANMichael As a workaround for now, you can set the renderType to "Bare".
<FlexBox id="container" renderType="Bare">
<Button width="400px" text="Button1"/>
<Button text="Button2" />
</FlexBox>
@boghyon Thank you for your input. This works in the latest version, but not in every version. If you specify 1.38.38 for example, it is not working. The value Bare was only introduced in Version 1.42.1, so every version below that is still supported ( = 1.38) should get a bugfix.
Is there another possible workaround? My target version is 1.38.x, so I still don't have a resolution.
Example: https://jsfiddle.net/sc984pum/11/ Source: https://openui5.hana.ondemand.com/1.44.36/#docs/api/symbols/sap.m.FlexRendertype.html
Hello @ANMichael,
We are stpping support of 1.38, so it willl be best that you upgrade to the latest and gratest version of UI5. Because we can not provide a workaround for this issue.
Please upgarde to the next stable version.
Best Regards, Gery
@GerganaKremenska Regardless of the version support, shouldn't FlexBox be fixed anyway without renderType="Bare"? The "Bare" render type was just mentioned as a workaround. I believe it should be working with a default render type too.
Hello @boghyon ,
The "Bare" type is not a workaround but it ensures to " avoid layout issues due to browser inconsistencies", also the sap.m.FlexBox form 1.38 until now has a lot of improvments and OpenUI5 is recomentding latest and gratest, in older versions we do not fix issues that are fixed in newer versions.
Best Regards, Gergana