-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Reset button not considered during Implicit submission of a form #3909
Comments
Interesting. And you have verified that typing and hitting I know you are likely wanting to test the |
I have checked that it works manually. Yeah I do know about the submit command, thanks. In my specific use case there is no submit button in the form and it has to be submitted by the user hitting the enter key. There is, however, a reset button. |
When will someone look into this bug? |
@Bigdragon13th Here is a work around:
|
The rules for implicit form submission (hitting https://www.w3.org/TR/html52/sec-forms.html#implicit-submission
So, we should only be looking at the first element of I'm looking at this change, and I don't understand why this second if statement isn't just Essentially since this line is only looking for any buttons that are NOT of type button, it will find both the |
@jennifer-shehane I think that line is to serve the behavior of
That's mean, if the form has no I guess that line missing the |
@RossLote Thanks for the workaround, but that's mean it'll only fix my machine issue, not all of my team and servers. |
@Bigdragon13th Thanks, yup, updated here: #4365 |
The code for this is done in cypress-io/cypress#4365, but has yet to be released. |
@jennifer-shehane Oh, one thing, I don't know if you guys already cover this case or not, but just for the FYI. Again, from the spec https://www.w3.org/TR/html52/sec-forms.html#implicit-submission
Meaning, these form can be submit using {enter} button even if there's no button in the form at all: <!-- Can be submit because there's only one field that blocks implicit submission -->
<form id="myForm">
<input type="text" />
</form>
<!-- Can be submit because there's only one field that blocks implicit submission -->
<!-- Since hidden input is not the blocker -->
<form id="myForm">
<input type="hidden" value="someValue" />
<input type="text" />
</form> While this form cannot be submit until we add some button: <!-- Cannot submit because there're more than one fields that blocks implicit submission -->
<form id="myForm">
<input type="text" />
<input type="text" />
</form> |
Released in |
Hey @Bigdragon13th, thanks! I have a PR open for this situation also here that did not make it into 3.3.2 #4574 |
@jennifer-shehane Glad to here that, thanks. Keep up a good work! |
Current behavior:
Cypress doesn't allow the user to implicitly submit the form with the
{enter}
key if either:reset
button before thesubmit
buttonreset
button but nosubmit
button.All that happens is the form is cleared.
Desired behavior:
Form should submit when Enter key is pressed if there is a reset button present
Steps to reproduce: (app code and test code)
Versions
cypress 3.2.0
The text was updated successfully, but these errors were encountered: