10

In the past there was an issue (reported here) where pressing the Enter key to select an IME suggestion would also submit the comment.

The good news is that we believe to have found the proper way to handle this, allowing you to use the Enter key to select your IME suggestion, while also still being able to use Enter to submit the comment if you're not in the middle of composing a word.

We've enabled this on the Japanese Language Meta site to make sure there are no unforeseen issues (every browser handles IME slightly different) and plan to enable it on the main Japanese Language site next, and after that network-wide.

If you use the IME editor regularly, please feel free to test it out (e.g., on the answer below here) and let me know if there's any issues.

I've written a blog post with the technical details of this change.

Thanks!


Update: This is now live on the main site. Please do still let us know if you see any bugs. Thanks!

  • 1
    Some technical details on the solution would be very interesting and appreciated. – deceze Jun 24 '16 at 18:29
  • @deceze I wrote a blog post and added a link to it. – Michael Stum Jun 24 '16 at 21:49
  • Cool stuff, thanks! – deceze Jun 25 '16 at 6:35
  • Just out of curiosity, did you try simply replacing the keyup handler with a keydown handler? And if you did, what browser / IME combo did it fail on? I'm asking because I'm using that method in SOUP, and if there's some situation where it doesn't work, I'd like to fix it. – Ilmari Karonen Oct 5 '16 at 18:40
  • @IlmariKaronen I'd have to get into the mindset again, but I think the problem with keydown was either that it wasn't optimal in case people held down the Enter key, or Safari on OS X (which emits an additional keydown event in addition to keyup). Sorry, don't remember the exact reasoning, but I did rule out keydown intentionally. – Michael Stum Oct 5 '16 at 18:43
  • Ah, Safari again. I really need to find some way to test SOUP on it. Thanks for mentioning the hold-down issue, though; I'll add a flag to SOUP so that multiple keydown events won't trigger repeated submissions unless there's a matching keyup event in between. – Ilmari Karonen Oct 5 '16 at 19:01
4

Would it be too much to ask for an option to toggle this behavior? I think some people will still find it uncomfortable that you can submit a comment by accident if you press enter one more time than necessary. I'm sure this happened to most of us on other websites before. To me personally it seems counterintuitive to have Enter work this way in a form that can have more than one line. I feel like I should be able to just go to the next line without anything else happening. Yes, formatting in comments is lost anyway, but still.

  • I agree that the improved IME handling is very nice, but on other SE sites, I also accidentally submit comments by pressing enter. Then I only have 5 minutes to fix the comment, although I sometimes take longer to write a comment. Even without [Enter] right in the text field, I can still submit the comment from the keyboard by pressing [Tab]→[Space] or [Tab]→[Enter], which I prefer. – Earthliŋ Jun 23 '16 at 12:34
  • The current implementation isn't a per-user setting, so unfortunately, no, we can't keep it as an option at this point. There's an old feature request to restore the don't-submit-on-enter behaviour from back when submitting on enter was first introduced. Six years later, I doubt we'd go back to that overall. A user preference is perhaps not out of the question, but that'd have to be a separate feature request that we'd have to evaluate alongside all others. – Adam Lear Jun 23 '16 at 15:39
  • Although I can understand this feature request, I personally think it's okay without the setting. There are plenty of other similar situations where hitting enter submits a message, like in most chat programs or websites for example, so it's something you have to adapt to when typing anyway. And if you do send a message early because you bumped enter, you can just delete it and post again, so it's not the end of the world. – snailcar Jun 23 '16 at 17:10
  • I found some userscripts for this: stackapps.com/questions/2061/… But they are outdated and don't seem to work anymore... – kuchitsu Jun 23 '16 at 17:50
3

Please use this answer to test out the comment functionality.

  • 1
    テストテストテストテストテストテスト・・・成功~ – snailcar Jun 22 '16 at 22:39
  • 1
    It seems to work :-) – snailcar Jun 22 '16 at 22:39
  • これもテストです。This is the best thing ever. – jmac Jun 23 '16 at 0:50
  • あいうえおあいうえおあいうえお – Chocolate Jul 16 '16 at 6:05
  • 大丈夫らしいです。最悪のことは行わない。 – virmaior Jul 16 '16 at 13:24
  • True fact about me: 私は魔法使いだ。Another fact: バナナが好きだ。(EDIT: Seems to work fine in Firefox on Debian Testing with XFCE!) – GoBusto Oct 18 '16 at 7:07
3

I don't think this always works. It seems to work most of the time, but I still end up submitting comments partway through. For example, today I typed this comment:

It looked like こになる was a typo, so I changed it to match the example (こになる).

This comment has two Japanese strings in it. The first one worked fine, but the second one submitted my comment, so I had to edit it to type the rest. This isn't the first time this has happened.

This is on Windows in SeaMonkey, for what it's worth.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .