-
Notifications
You must be signed in to change notification settings - Fork 402
[Bug][DynamicForm] OnBeforeSubmit does not fire when using a mandatory field in the FieldOverrides #1950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for submitting your first issue to this project. |
Same issue here! |
Same here. The problem seems to be that for fieldOverrides, the forms field-onChange handler is not triggered, leading to the fields newValue not being set in the DynamicForm. This did work correctly in version 3.15.0 though... |
Ok, so the point is you need to let the DynamicForm know that a field has changed. So if your override contains a TextField control for example, you'll need to implement an event handler, like private renderField = (
fieldProperties: IDynamicFieldProps
): React.ReactElement<IDynamicFieldProps> => {
return (
<>
<div className={styles.fieldWrapper}>
<TextField
label={strings.SiteName}
defaultValue={fieldProperties.value}
onChange={(ev, newValue) =>
fieldProperties.onChanged(fieldProperties.columnInternalName, newValue, true);
}
required={fieldProperties.required}
disabled={fieldProperties.disabled}
placeholder={fieldProperties.placeholder}
autoComplete="off"
/>
<text className={styles.fieldDescription}>
{fieldProperties.description}
</text>
</div>
</>
);
}; in version 3.15.0 you could use |
Category
[ ] Enhancement
[X] Bug
[ ] Question
Version
Please specify what version of the library you are using: [3.20.0]
Expected / Desired Behavior / Question
In DynamicForm, when I use fieldoverrides with a required field, onBeforeSubmit does not fire and the form is not submitted. By default the field was red (error) and when I type something it turns black and without an error message, but when I click submit nothing happens. if I update the list field as non-required, the dynamic form works fine.
Observed Behavior
In DynamicForm, when I use fieldoverrides with a required field, onBeforeSubmit does not fire and the form is not submitted.
Steps to Reproduce
By default the field was red (error) and when I type something it turns black and without an error message, but when I click submit nothing happens. if I update the list field as non-required, the dynamic form works fine.
Thanks!
The text was updated successfully, but these errors were encountered: