Form is not submitted after async validation failure

Hello,

I suppose that there is a bug when async function is used to validate form fields. This can be reproduced in form validation examples on official atlaskit example page:

  1. Open Form validation example here https://atlaskit.atlassian.com/examples/core/form/validation
  2. Open developer tools and start monitoring console messages.
  3. In username input field type “Test” -> wait 2 seconds
  4. “Nice one, this username is available” message will appear
  5. Click on “Next” button -> submitted data is shown in the console
  6. Clear username input field and type “jill” -> wait for 2 seconds
  7. “This username is taken by somebody, try something else” error message will appear
  8. Click on “Next” button -> submitted data is not shown in the console, which is expected
  9. Clear username input field and type “Test” -> wait for 2 seconds
  10. “Nice one, this username is available” message will appear
  11. Click on “Next” button
    Expected: Form is submitted and submitted data is shown in console
    Actual: submitted data is not shown in the console.

Can someone please take a look at this? Is this expected behavior? If yes, can someone please let me know how to change that example code so that it works like I am expecting?

Thank you,
Alexander