Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Client Script set Read-only HTML Field is shrunk when user is on another tab

sieusaopolo15
Giga Sage

Hi,
There is an behavior in my instance relates to HTML fields when it is read-only by client script and you can understand by watching the .gif down here. The current issue is when I'm on another tab then refresh the page the Read-only HTML field is shrunk and when I'm on the tab which has the HTML field it became normal again. I requested an instance to reproduce the case but doesn't work so I assume in my instance must have something missing

 

Note: I have deactivated all client scripts inside the tables and only have that one script which read-only the fields

1 ACCEPTED SOLUTION

HasanM
Kilo Sage

Hi @sieusaopolo15 ,

I watched your GIF. The read-only HTML field only shrinks when the form loads with another tab (Notes) active. When Idea Description is the active tab on load, it renders fine. This points to a timing issue: the read-only HTML viewer works out its height on load, and because its tab is hidden at that point, it gets almost no height and keeps it. That's why you see a one-line box with a scrollbar when you switch back.

Suggestions:

  1. Make the field read-only with a write ACL instead of a client script. The field then renders read-only on the server at load, so nothing redraws it on the client, and it's also more secure than client-side read-only.

  2. Your PDI test isn't like-for-like. In your instance it's the Idea table, but the PDI test was on Incident. Idea comes from a separate application, which may load its own UI Scripts, UI Macros or CSS on the form. Deactivating client scripts doesn't disable those, so try reproducing it on the Idea table in the PDI with the same tab layout.

  3. Compare the release and patch levels of both instances, as the behaviour may differ between versions.

If this answer helped you, please mark it as Helpful and Accept as Solution so others with the same question can find it.

View solution in original post

2 REPLIES 2

HasanM
Kilo Sage

Hi @sieusaopolo15 ,

I watched your GIF. The read-only HTML field only shrinks when the form loads with another tab (Notes) active. When Idea Description is the active tab on load, it renders fine. This points to a timing issue: the read-only HTML viewer works out its height on load, and because its tab is hidden at that point, it gets almost no height and keeps it. That's why you see a one-line box with a scrollbar when you switch back.

Suggestions:

  1. Make the field read-only with a write ACL instead of a client script. The field then renders read-only on the server at load, so nothing redraws it on the client, and it's also more secure than client-side read-only.

  2. Your PDI test isn't like-for-like. In your instance it's the Idea table, but the PDI test was on Incident. Idea comes from a separate application, which may load its own UI Scripts, UI Macros or CSS on the form. Deactivating client scripts doesn't disable those, so try reproducing it on the Idea table in the PDI with the same tab layout.

  3. Compare the release and patch levels of both instances, as the behaviour may differ between versions.

If this answer helped you, please mark it as Helpful and Accept as Solution so others with the same question can find it.

Hi @HasanM,

Your option 1 is great, the ACL write on the field has done the trick and it works perfectly match with my requirements. Thanks!