cancel
Showing results for 
Search instead for 
Did you mean: 

Using calc(expr) as CSSSize in UI5 - linter fails

former_member600456
Discoverer
0 Kudos

Hi,

according to the documentation, it should be possible to use calc: https://sapui5.hana.ondemand.com/1.50.8/#/api/sap.ui.core.CSSSize (we are using SAPUI5 1.50.8)

But using it gives us an error:

SAPUI5: (xml_invalid_property_value)

The property value is incorrect: <calc(100% - 1rem)> is type <string>, expected <sap.ui.core.CSSSize> for property <width>. Please enter the correct value for the mode type.

We use it like this:

<Select width="calc(100% - 1rem)">

Is this wrong?

Is it possible to disable selected SAPUI5 rules?

Accepted Solutions (1)

Accepted Solutions (1)

former_member560141
Participant

You can do this in the css file. Personally i would have it there. add a class to the element and in you css file add

.className{
width: calc(100% - 1rem);

}

Answers (1)

Answers (1)

mvaibhav
Contributor
0 Kudos

HI Marcel,

you can ignore the error in the Web Ide. The calculation would be done as expected on the browser.

In order to disable the rule, you can do it in Project Settings -> Java Script -> Rules in webide.

You can also change it from error to warning in that section.

Thanks,

Vaibhav Maheshwari

former_member600456
Discoverer
0 Kudos

I can't change the Fiori rules there

mvaibhav
Contributor
0 Kudos

Hi Marcel,

GO to Project Settings -> XML -> Validator

Change the drop down to Basic XML to disable Fiori XML Validation.

Thanks,

vaibhav