This PR includes the following proposed change(s):
[!IMPORTANT]
This fix is symptomatic of a larger issue with re-rendering not working properly for props.rawErrorsin the custom validation.
When the rawErrors array is updated, the FieldTemplates are not re-rendering as expected. However, since most errors are self-contained, the change events trigger a re-render of the component, which resolves the issue. This behavior doesn't apply to the PMP not in dropdown and Pest Management Plans inputs, as these are independent from each other but share a custom validation rule. So when the error is removed, a re-render is not created.
Smaller Fixes
Fixed issue in SingleSelectAutoComplete, where non-responses need to be undefined and not null. this triggers must be a string errors when user deletes an input
Reduce customErrorTransformer to be more DRY and readable
FormContainer.tsx
Flip padding to x instead of explicit left/right
manually call validateForm() in the useEffect when we are doing a Chemical Treatment form
The useEffect is fired by the debounced function, so this won't produce n validation checks where n is keystrokes
When we use liveValidate(), nothing gets logged because its an implicit action. Opposite of this, when we explicitly perform validateForm() Rjsf fires a console.error containing the validation errors
We can override handling of validateForm() by adding the onError prop to <Form>, eliminating the logs.
Closes #3687
Ticket #3706 created to address the overarching Render concerns
Overview
This PR includes the following proposed change(s):
Smaller Fixes
undefined
and notnull
. this triggersmust be a string
errors when user deletes an inputcustomErrorTransformer
to be more DRY and readableFormContainer.tsx
x
instead of explicit left/rightvalidateForm()
in the useEffect when we are doing a Chemical Treatment formn
validation checks wheren
is keystrokesliveValidate()
, nothing gets logged because its an implicit action. Opposite of this, when we explicitly performvalidateForm()
Rjsf fires a console.error containing the validation errorsvalidateForm()
by adding theonError
prop to<Form>
, eliminating the logs.Closes #3687 Ticket #3706 created to address the overarching Render concerns