question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reset button not considered during Implicit submission of a form

See original GitHub issue

Current behavior:

Cypress doesn’t allow the user to implicitly submit the form with the {enter} key if either:

  • there is a reset button before the submit button
  • there is a reset button but no submit 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)

    <form action="." method="GET">
        <input name="search" id="search-field" type="text">
        <button type="reset">Reset</button>
        <button type="submit">Submit</button>
    </form>
cy.get('#search-field').type('foo{enter}')

Versions

cypress 3.2.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
cypress-bot[bot]commented, Jun 27, 2019

Released in 3.3.2.

1reaction
jennifer-shehanecommented, Jun 28, 2019

Hey @Bigdragon13th, thanks! I have a PR open for this situation also here that did not make it into 3.3.2 https://github.com/cypress-io/cypress/pull/4574

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reset button is working before form submission but not after
Reset button is working fine before the form submission. Once the form is submitted, my View consists some values which got pre-populated. After...
Read more >
Forms in HTML documents - W3C
A form may contain more than one submit button. reset buttons: When activated, a reset button resets all controls to their initial values....
Read more >
The Enter Key should Submit Forms, Stop Suppressing it
When filling out a form, pressing enter in a textbox should submit the form. This is known as an implicit form submission. Despite...
Read more >
A custom image for a reset button? - Jukka K. Korpela
Perhaps this is caused by the mistaken assumption that a reset button is an obligatory part of a form. More probably, authors just...
Read more >
Reset and Cancel Buttons - Nielsen Norman Group
Reset can be useful for forms that satisfy both of the following criteria: ... Even if a user were to use a form...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found