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

Enter in description textbox submits form #1794

Closed
adamopenweb opened this issue Sep 7, 2017 · 7 comments
Closed

Enter in description textbox submits form #1794

adamopenweb opened this issue Sep 7, 2017 · 7 comments

Comments

@adamopenweb
Copy link
Collaborator

As described in this bug: webcompat/web-bugs#9706

If you press enter in the description textbox, it submits the form before you've (potentially) finished filling it out.

Maybe we should prevent this behaviour and force the user to click the button?

@miketaylr
Copy link
Member

Yeah, that's crappy behavior, IMO.

@zoepage zoepage added this to the Community Sprint milestone Nov 13, 2017
@softvision-sergiulogigan
Copy link
Collaborator

I just made the "Enter" mistake on webcompat/web-bugs#14683
I too think that submitting an issue should be done exclusively by clicking the Report button (or Tabbing your way there and hitting the Spacebar)

Curious enough, the issue got submitted as Anonymus, despite the fact I was logged in.

@miketaylr
Copy link
Member

Curious enough, the issue got submitted as Anonymus, despite the fact I was logged in.

Ah, I know why. We rely on which button you've clicked (to allow logged in users to report things anonymously if they prefer). The current bug is sort of undefined behavior...

@softvision-sergiulogigan
Copy link
Collaborator

softvision-sergiulogigan commented Apr 3, 2018

Let's put this webcompat/web-bugs#16299 for reference.

@Regaddi
Copy link
Member

Regaddi commented Apr 16, 2018

Description is not a multiline field at all, it's just a normal single line input field.
Hitting enter there for sure triggers a submit (which applies to every single line input field in that form, like URL, browser and operating system).

However it only triggers the form submit, when all required fields contain technically valid information.

We could prevent the submit by hitting keyboard enter generally, which is from an accessibility point of view not ideal. Also it would require some extended event handling for keyboard events on the form in a whole.

So there are multiple possible approaches to tackle this issue:

  1. Prevent enter events and force the users to click one of the submit buttons
  2. Before submitting the form with enter, let the user confirm the action by using a confirm dialog (in the simplest form this might be a window.confirm(). An extended version might take usage of some HTML modal dialog with a "preview" of the issue details.
  3. Do nothing, since enter is a completely valid way to submit web forms.
  4. Instead of submitting the form using enter we could tab to the next field, which is probably not, what a user expects to happen when he hits enter.

What do you think? @zoepage @miketaylr

@miketaylr
Copy link
Member

miketaylr commented Apr 16, 2018

I think 1 is the least surprising.

@zoepage
Copy link
Member

zoepage commented Apr 17, 2018

+1 on 1. :)

miketaylr pushed a commit that referenced this issue Apr 17, 2018
Fixes #1794 - Prevent submit by enter in bugform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants