The HTML field is showing a blank space and not reduced to lesser size when the field is made read-only with a UI Policy


Description

The HTML field is showing a blank space and not reduced to lesser size when the field is made read-only with a UI Policy

Steps to Reproduce:
1. Make a UI Policy to set the HTML field read-only
2. Open a KB which has less text on the HTML field
3. Notice that it is showing the whole area of 300px for the HTML field

It will look like as below:

Cause

This is caused because of the dictionary entry of that specific HTML field, has set the height as a static value of 300. When the field is not-read only, the default height will still be 300, but the user will still have the option to reduce it as per their requirement with +/- symbol.

However, when the field is read-only, the dictionary attribute again kicks in and does not get changed. Hence it shows the behaviour.

In the dictionary of the field, below attribute is added:

editor.height=300

This makes the height static, and the UI policy is not reducing it.

Resolution

The workaround is to remove this attribute, so the height becomes dynamic and not static.