You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when following validateOnBlur, mobx-react-form attempts to validate a field on blur using a debounce, but if the parent field is deleted before this debounce timeout expires, the validator attempts to invalidate a non-existent field, causing a (Error): Validation Error: Invalid Field Instance
This occurs when:
focus an input for a parentField's nested field
click the remove button (which calls parentField.onDel)
wait a few ms for the debouncer
Invalid Field Instance thrown because, indeed, the field instance no longer exists
A (horrible) workaround at the moment is to simply delay the removal of the field until after validation has occurred.
I was unable to disable validation just-in-time because the debounce is scheduled immediately after the input is defocused, and before the event to remove the field is received, so there's no way to cancel it.
One option would be to disable validateOnBlur altogether and implement it ourselves, only calling the validate function if the removal event was not called within some duration.
when following
validateOnBlur
, mobx-react-form attempts to validate a field on blur using a debounce, but if the parent field is deleted before this debounce timeout expires, the validator attempts to invalidate a non-existent field, causing a(Error): Validation Error: Invalid Field Instance
This occurs when:
parentField
's nested fieldparentField.onDel
)Invalid Field Instance
thrown because, indeed, the field instance no longer existsA (horrible) workaround at the moment is to simply delay the removal of the field until after validation has occurred.
The text was updated successfully, but these errors were encountered: