Skip to content
Snippets Groups Projects

When user clicks to add comment, move focus to comment text area

Merged decentral1se requested to merge rdn32:1338757_focus-fix2 into develop
1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
@@ -10,9 +10,13 @@ user clicks outside the area
});
$(".show").live("click", function(e) {
var this_comment_form = $(this).parent().siblings().find(".form_comment");
var this_comment_form = $(this).parent().siblings().find(".form_comment");
$(".form_comment").hide();
this_comment_form.show();
// Ensure "Post" button is on screen
this_comment_form.find(".button").focus();
    • Author Contributor

      Created by: jogwen

      Works well. It would be nice (but not vital) if we could scroll to a position where we can see the Post button just below the textarea as well?

Please register or sign in to reply
// Move focus to where user will type
this_comment_form.find("textarea").focus();
e.stopPropagation();
e.preventDefault();
});
Loading