IDynamicFormProps and IDynamicFieldProps should have property class that should be appended to the default class style in the render() method, if specified.
IDynamicFormProps needs to have an optional onPreRender(state: IDynamicFormState) delegate that is going to be called before render(). This will allow applying business logic (making fields required, disabled, hidden) and dynamic styles (via class value) to fields depending on current field values, query string parameters, session storage, etc. This may also negate the need for the disabledFields and hiddenFields properties.
Similarly, onRenderField(fieldProperties: IDynamicFieldProps): React.ReactElement<IDynamicFieldProps> delegate can replace the fieldOverrides. If the delegate returns a null value, default rendered shall be used.
Observed Behavior
Currently, it is difficult to implement dynamic behaviors and style to form controls without implementing a field renderer via fieldOverrides. For example, we simply need to set a default value and disable input control when a specific query string value is specified. It was super easy to implement with JSLink injection.
There is also a bug in the DynamicForm.module.scss@media style definitions for the .sectionFormField class. It appears that the larger the screen size is, the smaller field controls become which makes the unusable on 4K screens. For example, check the size of the rich text control in the Notes field.
This behavior is easier to replicate when bodySections formatter is defined as follows:
Category
Version [ 3.17.0 ]
Expected / Desired Behavior / Question
IDynamicFormProps
andIDynamicFieldProps
should have propertyclass
that should be appended to the defaultclass
style in therender()
method, if specified.IDynamicFormProps
needs to have an optionalonPreRender(state: IDynamicFormState)
delegate that is going to be called beforerender()
. This will allow applying business logic (making fields required, disabled, hidden) and dynamic styles (viaclass
value) to fields depending on current field values, query string parameters, session storage, etc. This may also negate the need for thedisabledFields
andhiddenFields
properties.Similarly,
onRenderField(fieldProperties: IDynamicFieldProps): React.ReactElement<IDynamicFieldProps>
delegate can replace thefieldOverrides
. If the delegate returns anull
value, default rendered shall be used.Observed Behavior
Currently, it is difficult to implement dynamic behaviors and style to form controls without implementing a field renderer via
fieldOverrides
. For example, we simply need to set a default value and disable input control when a specific query string value is specified. It was super easy to implement withJSLink
injection.There is also a bug in the
DynamicForm.module.scss
@media
style definitions for the.sectionFormField
class. It appears that the larger the screen size is, the smaller field controls become which makes the unusable on 4K screens. For example, check the size of the rich text control in theNotes
field.This behavior is easier to replicate when
bodySections
formatter is defined as follows: