Skip to content
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

[Cart] Pressing "enter" in quantity field submits form and redirects to checkout #2250

Open
KaichenWang opened this issue Jan 23, 2023 · 3 comments
Labels
By: Team Category: Bug Something isn't working Severity: 3 Normal/Low Severity Workstream: B2B

Comments

@KaichenWang
Copy link
Contributor

KaichenWang commented Jan 23, 2023

Describe the current behavior

  • In the cart, edit quantity and hit "enter"
  • Cart form is submitted
  • Redirected to checkout

Describe the expected behavior

  • In the cart, edit quantity and hit "enter"
  • Quantity is updated in the cart

Version information (Dawn, browsers and operating systems)

  • Dawn Version: 8.0.0-rc
  • Chrome Version 109.0.5414.87
  • macOS Version 13.0.1

Possible solution

Prevent "enter" from submitting the form

Additional context/screenshots

Video demonstrating current behaviour

screencast.2023-01-23.12-16-31.mp4

Video demonstrating browser input validation

If the quantity entered does not respect the input's min, max attributes a browser validation error may also appear/flash (instead to redirecting to checkout).

screencast.2023-01-23.12-17-33.mp4

Screenshot 2023-01-23 at 12 19 33 PM

Note: keep a11y concerns in mind when fixing this

@KaichenWang KaichenWang added the Category: Bug Something isn't working label Jan 23, 2023
@ludoboludo
Copy link
Contributor

I feel like we had a discussion about this before and pressing enter within a form should submit it. As the expected behaviour 🤔 Brought up here but I think since we do have a submit button in the form it could be ok. Maybe something to confirm with some of our accessibility experts.

Here is an interesting post/comment about the use of implicit submission

@KaichenWang
Copy link
Contributor Author

@ludoboludo thanks for this context! Definitely will have to keep a11y in mind. Created this issue because a few folks have flagged the form submission while editing quantity as "unexpected" behaviour, so just want us to revisit this. Additionally the flashing of browser min/max validation as a side-effect is something we'd ideally want to avoid as well.

@KaichenWang KaichenWang changed the title [Cart] Pressing "enter" in quantity field submits submits form and redirects to checkout [Cart] Pressing "enter" in quantity field submits form and redirects to checkout Feb 3, 2023
@web-orbit12
Copy link

I mean, you're not supposed to hit enter when editing quantity. This does not happen only with this theme but will happen with almost any form.

@shirmung shirmung added the Severity: 3 Normal/Low Severity label Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
By: Team Category: Bug Something isn't working Severity: 3 Normal/Low Severity Workstream: B2B
Projects
None yet
Development

No branches or pull requests

4 participants