New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block any further submissions until the current one finishes. #3582
Conversation
@@ -77,9 +88,10 @@ export class AmpForm { | |||
* @private | |||
*/ | |||
handleSubmit_(e) { | |||
if (e.defaultPrevented) { | |||
if (e.defaultPrevented || this.state_ == FormState_.SUBMITTING) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to call preventDefault
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think we should. Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -80,6 +91,12 @@ export class AmpForm { | |||
if (e.defaultPrevented) { | |||
return; | |||
} | |||
|
|||
if (this.state_ == FormState_.SUBMITTING) { | |||
e.preventDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you capture this in a test case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pointed out where this is being captured in test.
PTAL |
LGTM |
ITI: #3343