Openui5: Page title not centered anymore since release 1.72.0

Created on 29 Nov 2019  路  10Comments  路  Source: SAP/openui5

Hey UI5 Team,

I am currently facing a bug or feature for the component sap.m.Page. Titles are not getting centered anymore if I am using a OpenUI5 version newer than 1.71.4. I tested this with Chrome and Safari on MacOS. Seems like there are two style classes applied on the title and ".sapMBarTitleStart .sapMBarPH" is overriding ".sapMBarMiddle".

OpenUI5 version: 1.72.0 and later

Browser/version (+device/version):
Chrome (78.0.3904.108) on MacOS

Any other tested browsers/devices(OK/FAIL):
Safari (13.0.3) on MacOS
MS Edge

URL (minimal example if possible):
OpenUI5 Samples

User/password (if required and possible - do not post any confidential information here):

Steps to reproduce the problem:

  1. Open Page
  2. Take a look on the title "Centered Title"

What is the expected result?
a centered title
css is text-align: center

What happens instead?
title is aligned to the left
css is text-align: start

Any other information? (attach screenshot if possible)
image

All 10 comments

I think it's not a bug but I don't like it. I used this CSS and works.
.sapMBarTitleStart .sapMBarPH { text-align: center; }

Hello,

This is a feature. There is a property called titleAlignment, with this property you can align the page title. . If set to TitleAlignment.Auto, the Title will be aligned as it is set in the theme (if not set, the default value is center); Other possible values are TitleAlignment.Start (left or right depending on LTR/RTL), and TitleAlignment.Center (centered).

Best Regards,
Tsanislav

Hey @tsanislavgatev ,
thanks for you response. I didn't noticed this new property. I am now seeing that the change was announced in the change log. Is there an easy way to set this option globally without creating a complete new custom theme?

Hi kruemelmonstr,
you just need to set the provided property to what your needs are.

Regards, Mihail.

Hi,

to add a the property works, but it shows an error in the Web IDE
Picture1

@tfey - maybe the schema files you are using for validation are not up to date.

AFAIK, WebIDE takes the information for XMLView validation from the release that is configured as minVersion for the app (_but I'm not 100% sure_).

I changed the theme from sap_fiori3 to sap_belize and title began showing in the middle of the page.

@prtkkr ; it worked for me too. Big Thanks

@prtkkr @HarikrishnaTheDeveloper @kruemelmonstr @portatifparcacik Guys, just change the titleAlignment to "Center". No need to change or create an entire custom theme.

Was this page helpful?
0 / 5 - 0 ratings