ampproject / ampproject/amphtml
FR: Dedupe verify-xhr on blur caused by clicking submit button causing action-xhr
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
## What's the issue?
During mouse operation without `blur`, both `action-xhr` and `verify-xhr` are getting called at the same time. Desired behavior is that, first `verify-xhr` getting called and then based on result, '`action-xhr` is getting called
## How do we reproduce the issue?
1.
https://amp.dev/documentation/examples/components/amp-form/#form-verification
```html
That username is already taken
Invalid character in username
Success! Thanks {{name}} for trying the
amp-form demo! Try to insert the word "error" as a name input in the form to see how amp-form handles errors.
{{#verifyErrors}}
{{message}}
{{/verifyErrors}}
{{^verifyErrors}}
Something went wrong. Try again later?
{{/verifyErrors}}
Submission failed
```
2. In `verification-username`, type "error", but do NOT press any key like `TAB`. But, after typing "error", just move your mouse and click "Check"
## What browsers are affected?
All browsers
## Which AMP version is affected?
Looks irrelevant; but 1906191709480
Contributor guide
Assessment
This issue has not been assessed yet.