Skip to Content

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

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 11 at 09:51 AM

    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);

    }

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 11 at 09:23 AM

    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

    Add comment
    10|10000 characters needed characters exceeded