When I look at the $form
of my form, I see the following boolean properties:
focus
pending
pristine
retouched
submitFailed
submitted
touched
valid
validated
validating
In need to determine if an attempt was made to submit the form, whether it be successful or not. I would expect the submitted
property or even submitFailed
to be used to indicate that, but not so. If I open a form and immediately submit it, both of those properties are false. The only time either is true is if I attempt to submit (unsuccessfully) and then correct any errors. In that case, submitFailed
turns true.
Something on $form
should indicate if a submit has ever been attempted.
答案 0 :(得分:0)
您在列表中遗漏了submitSucceeded
。这告诉表单是否已提交,在验证错误后它将恢复为false
。如果这对您不起作用,可以使用reducer.plugin
添加reducer并使用表单的操作减少submitAttempt值(或者将自己的reducer添加到rootReducer中)。