Question about the conditions under which onSubmitInvalid is called #1776
              
                Unanswered
              
          
                  
                    
                      YESHYUNGSEOK
                    
                  
                
                  asked this question in
                Ideas
              
            Replies: 1 comment 3 replies
-
| You are likely experiencing problems that this PR solves: #1697 | 
Beta Was this translation helpful? Give feedback.
                  
                    3 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the
onSubmitInvalidcallback is not triggered every time the fields are invalid at the moment of submission, but only once at the initial attempt. To have it triggered every time, you need to pass canSubmitWhenInvalid={true} as a prop (it actually took me quite a bit of digging to find out that this prop even exists). By default, this value is set to false.From my personal perspective, I would expect
onSubmitInvalidto be called on every submit attempt whenever the form is invalid. Is there a specific design reason behind why it only works this way by default?Beta Was this translation helpful? Give feedback.
All reactions