openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Dialog - sap.m.VBox/sap.m.FlexBox - it is not possible vertical align center

Open GKSoftwareDevelopment opened this issue 7 years ago • 4 comments

OpenUI5 version:

Browser/version (+device/version): Chrome, Firefox, Safari

Tested on OpenUI5 version 1.60.20, 1.72.1

URL (minimal example if possible): Dialog_alignment.zip

Steps to reproduce the problem:

  1. Open attached project (index.html)
  2. Button is correctly aligned to center of Page
  3. Press on button - dialog appears
  4. Button is horizontally aligned correctly, but not vertically to center

What is the expected result? It is possible to align Button to the center of dialog.

What happens instead? Button is horizontally aligned correctly, but not vertically to center

Any other information? (attach screenshot if possible)

image

It seems that problem is in the chain of relative heights, where one div (see attached screenshot) has height "auto", which causes that VBox (or FlexBox) cannot have full height.

GKSoftwareDevelopment avatar Nov 26 '19 07:11 GKSoftwareDevelopment

Hello, The project doesn't work. Can you please check it or just create a JSBin snippet?

Thanks

tsanislavgatev avatar Nov 26 '19 11:11 tsanislavgatev

Project works, only you need serve it from some file server (Apache, or use some gulp task like gulp-server-livereload, gulp-serve) or you can open it some IDE like IntelliJ IDEA which will do the same job for you when you open index.html.

Project itself is based on sample downloaded from here https://openui5.hana.ondemand.com/#/entity/sap.m.Dialog/sample/sap.m.sample.Dialog.

Unfortunatelly I cannot create such example in JSBin, because of fragment loading.

GKSoftwareDevelopment avatar Nov 26 '19 12:11 GKSoftwareDevelopment

Hello,

If you want to have it in the middle, you have to set verticalScrolling to false, because the scrolling creates a wrapper over the dialog content, so the 100% Height is becoming less than full height of the dialog.

If you have any other questions you can contact us.

tsanislavgatev avatar Nov 26 '19 13:11 tsanislavgatev

Thx a lot. I works like a charm..

GKSoftwareDevelopment avatar Nov 27 '19 11:11 GKSoftwareDevelopment