Form elements should be rendered properly in viewmode

Found in

EPiServer.Forms 4.27.1

Fixed in

EPiServer.Forms 4.28.0

Created

Feb 19, 2020

Updated

Apr 03, 2020

State

Closed, Acceptance tests pass


Description

Prerequisite: A form has a field dependency configuration.
When the page is loaded, the elements are shown/hidden based on dependency configuration. Normally, this works as expected. But, in some cases (such as network latency), when the page loads, all elements are shown but, 1 second later, some elements are hidden.

The current behavior is to show all elements by default. Then, the Field Dependency Tracker runs. When it finishes, a form's elements will be shown/hidden depending on the configuration.

The solution: Hide elements with valid field dependency settings by default by adding 'hide' class while rendering. When the form is loaded and JS code is executed, the Field Dependency Tracker is triggered to show/hide form elements based on dependency settings against form submission data.