Page MenuHomePhabricator

Allow user to publish wish with enter key
Open, Needs TriagePublic

Description

While creating or editing a wish with the wish submission form, pressing enter does not save the wish.

Acceptance criteria:

With the cursor on certain fields, pressing enter should save the wish.

Exactly which fields these should be is up for debate. I would suggest:

  • Wish title
  • Which type best describes your wish?
  • Which projects is your wish related to?
  • It's something else
  • Primary affected users

This should not happen on all fields. For example,

  • Pressing enter on Describe your wish should create a newline
  • Pressing enter on Phabricator tasks (optional) should create a lozenge around your current input

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone

Event Timeline

It's normal for HTML forms to be submitted when the enter key is pressed while focus is in a text field (note, note a textarea, nor I think any other types of field). But this can be changed, so we don't necessarily have to make it submit it. We could also set the enterkeyhint attribute, which would help mobile users know what would happen (doesn't help desktop, as far as I can tell).

If we expect the form to behave similarly to the normal wikitext editing form (i.e. what's familiar to users) then "enter = submit" is probably a reasonable way to go.

Can't we just change the form to use an actual form tag ala <form @submit.prevent="handleSubmit">? Then you get said behaviour for free. VisualEditor already knows to intercept the Enter key.

Yep, I think that's the simplest way. And do we need to change the button to be of type submit as well?

And do we need to change the button to be of type submit as well?

Presumably!