Closed aisingoro closed 5 years ago
Unfortunately we have to close this issue as there is not enough information to reproduce the problem. We have many tests that {enter}
works, so we will need to know what is specific to your application that would make it not work here.
Please provide the HTML you are testing against, the error message that you are seeing, and a reproducible example that we can run locally and we will reopen the issue. 🙏
I'm also having this issue right now. I uploaded a sample system for you to check. See https://github.com/jodelasur/cypress-issue-4495.
The issue for me is that the submit is not firing. I'm assuming this is because of the 1st "other situation" listed in https://docs.cypress.io/api/commands/type.html#Form-Submission:
Does not submit a form if there are multiple inputs and no submit button.
However, looking at the spec referenced, https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission, it says (with emphasis added):
If the form has no submit button, then the implicit submission mechanism must do nothing if the form has more than one field that blocks implicit submission,
The form in the sample system has two inputs, one text and one hidden. It seems Cypress doesn't submit the form because there are multiple inputs. But per the spec, text input blocks implicit submission, but hidden doesn't. That means there's just one field that blocks implicit submission (not more than one), so the form should still submit.
I think my understanding of this is correct since browsers I've tested with (Chrome, Firefox) submits the form correctly. Also, when I add another text field to the form, that's the time when the browsers don't submit, conforming to the spec.
Hope this gets fixed.
oh boy.
Yes, I believe your assessment is correct. Also, yes, the form does an implicit submission manually within your example.
I've simplified the HTML example for our testing purposes as shown below - this form should submit when typing {enter}
in the input of type text.
<form>
<input type="text">
<input type="hidden">
</form>
The spec is indeed very confusing 🤣
The code for this is done in cypress-io/cypress#4574, but has yet to be released. We'll update this issue and reference the changelog when it's released.
Released in 3.4.0
.
Current behavior:
I've already tried:
But it doesn't work. I've also tried:
And:
they're all right.But ENTER isn't.