ampproject / ampproject/amphtml

FR: Dedupe verify-xhr on blur caused by clicking submit button causing action-xhr

Open
#23,029 10 comments 1 reaction 1 assignee Claimed by @caroqliu View on GitHub
P2: Soon Stale Type: Feature Request WG: components
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.