[Dynamic Form] Implement @class extensibility for DynamicForm and DynamicField, add onPreRender delegate. #1794
Labels
status:working-on-it
Known issue / feature being addressed. Will use other "status:*" labels & comments for more detail.
type:enhancement
New feature or enhancement of existing capability
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:The text was updated successfully, but these errors were encountered: