Not the same as this, but probably even worse, it's undesired behavior: when your browser asks you if you want to close a window and you confirm by hitting Enter, that key hit also gets intercepted by StackOverflow which is the next window and the result of it may be, for example, a submitted comment. This happened a lot with me, and it's definitely not a double-Enter. Answering OK with the mouse is fine.

I think it's natural to lookup something in another browser window before you post your comment. And it's a bug anyway.

So far it happened a lot in Safari/OSX10.6 and to be honest I don't want to experiment in other browsers, as the result of it is a submitted comment. To reproduce:

  • Open StackOverflow in Safari, go to some post
  • Hit "add comment", start typing until you at least reach the minimum (15 chars, is it?)
  • Open a new browser window, go to Google.com, search for something
  • Close your browser with Google Search results: the latest version of Google Search makes at least Safari ask with a modal dialog box if you are sure about closing it, because Safari thinks you filled in a form and didn't submit it
  • Hit Enter in response: the window with Google Search closes and your comment on SO gets submitted

Edit instead of doing Google Search you can as well open StackOverflow, start asking a question, then try to close the window: both StackOverflow and the browser ask you if you are sure about leaving the page.

  • Have not been able to replicate on IE8 on XP, not within another browser window, nor from another tab, nor from anoter window opened from another tab with focus returned to SO.
    – Grace Note StaffMod
    Commented Nov 5, 2010 at 14:23
  • 1
    No, Firefox is fine.
    – mojuba
    Commented Nov 5, 2010 at 14:31
  • If you see this comment, it's confirmed in Safari.
    – mojuba
    Commented Nov 5, 2010 at 14:34
  • Chrome is fine too.
    – mojuba
    Commented Nov 5, 2010 at 14:37
  • @mojuba, no it is not: Enter posts comments as well, if you use context menu (via keyboard), select a menuitem, press Enter - opps a comment submitted.
    – bestsss
    Commented Dec 27, 2011 at 15:33
  • This also occurred for me in Safari 8.0.2 while using OS X's spotlight to switch to another app. Hitting enter in spotlight to launch the app also posted the comment.
    – D.G.
    Commented Jan 29, 2015 at 21:22

2 Answers 2


The problem (if it is one) is that the event is on keyup, so it fires when the Enter key is released, not pressed. You're pressing Enter to close Safari's alert dialog, and releasing it after SO has focus again. So it's actually much easier to reproduce:

  • Type your comment on SO
  • Unfocus the browser
  • Hold down Enter
  • Refocus the browser and release Enter

I would expect this to submit the comment in all browsers, but I haven't tested any except Chrome

  • Let's see how well your theory holds up! (Yeah, it totally happened here on IE8, XP)
    – Grace Note StaffMod
    Commented Nov 5, 2010 at 17:06
  • Ooh, now I have to try! Yes, it works in IE7 on Vista.
    – mmyers
    Commented Nov 5, 2010 at 17:08
  • Trying in Firefox... Yes, it happens with Firefox 4b6 Commented Nov 5, 2010 at 19:34
  • 1
    Ohh i see now!! This is silly :( Commented Jul 2, 2011 at 20:50
  • you don't even need to switch to another window. just unfocus (blur) the comment field, hold enter, focus the textfield again and release enter. Commented Sep 27, 2011 at 20:10
  • In Firefox it still works
    – Mołot
    Commented Jul 10, 2013 at 14:19
  • latest chrome on latest ubuntu
    – 000
    Commented Jul 10, 2013 at 16:06

I fear this bug has another, much more annoying, twist to it when using more complicated input languages (e.g. Chinese).

The following "works" in Mac OS:

  1. Start a new comment and type away to overcome the minimum length barrier
  2. Switch your input language to "Pinyin - Traditional" (or any other language that requires character selection via keyboard will do)
  3. Type an "a".
  4. Select a character from the OS dialog and press enter
  5. Unhappiness
  • For sites that require the use of an IME, like a Chinese or Japanese language site, the SE team has the ability to turn off Enter submitting comments. For example, the Japanese site had this issue, but using the enter key no longer submits comments over there, which makes it possible to select the appropriate character from the IME. As far as I know, this is a site-level setting, so you'll still have trouble on sites like StackOverflow. See also meta.stackexchange.com/q/63644/160551
    – Troyen
    Commented Sep 27, 2011 at 21:34
  • ah, thanks for your comment! i chose chinese as an example because i thought everyone would understand; in my case it's something very different: i've created a fake input language that allows me to insert greek alphabet and a few other characters by their name. oh well, guess this is not a #1 priority :) Commented Sep 29, 2011 at 23:49

You must log in to answer this question.

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