The title basically says it all.

When I type a comment and then press Tab, the Add comment button will get focus so that I can just press Enter to post it.

But when I edit a comment and then press Tab, the Save comment button won't get focus, instead the Add comment button below it will incorrectly get the focus.

To fix this, all you need to do is to set the correct tabindex.

  • is that the case? hmm - for me it goes to [Save Edits]; was it fixed already? Jan 11, 2010 at 23:28
  • 5
    Seems to work great if you reload the page, since the button and box for new comments are gone then, with only an "add comment" link remaining. But if you post a new comment and then (without refreshing) immediately click "edit", you'll have two edit fields and two buttons - and if you happened to have focus in the wrong place just prior to this, you'll find either the "add comment" edit field or the "add comment" button next in line. I suspect both the "edit comment" edit field and the "edit comment" button need tabIndexes...
    – Shog9
    Jan 12, 2010 at 1:02

1 Answer 1


I have seen this, but it can be hard to reproduce -- and I wonder if it's browser specific.

For example right now when I clicked "add comment" on the question, typed, and pressed TAB, the focus went to add comment.

Perhaps more experimentation is in order?

  • The comment of Shog9 has it right. It only fails if you edit comment immediately after adding it (thus, without refreshing the page).
    – user138231
    Jan 13, 2010 at 16:07
  • It just happened to me in FireFox 3.5. It was right after adding the comment to stackoverflow.com/questions/2069231/…. Jan 15, 2010 at 3:36
  • This bug seems to be fixed now (thanks), but the question is still on status-review.
    – user138231
    Apr 13, 2010 at 16:48

You must log in to answer this question.