Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
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.rawErrors
in 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
andPest 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
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