From 4ed3298d2289aa6de88ea4f0a6cddfb6f8c6c23c Mon Sep 17 00:00:00 2001
From: Ide Braakman <ide@ezcompany.nl>
Date: Fri, 20 Jul 2018 16:05:16 +0200
Subject: [PATCH] Issue #2987132 by idebr: Reply button can be pressed multiple
 times, resulting in multiple comment forms

---
 src/Controller/AjaxCommentsController.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/Controller/AjaxCommentsController.php b/src/Controller/AjaxCommentsController.php
index a919afa..fbaca9b 100644
--- a/src/Controller/AjaxCommentsController.php
+++ b/src/Controller/AjaxCommentsController.php
@@ -661,9 +661,10 @@ class AjaxCommentsController extends ControllerBase {
         return $response;
       }
 
-      // Remove any existing status messages in the comment field,
-      // if applicable.
+      // Remove any existing status messages and ajax reply forms in the
+      // comment field, if applicable.
       $response->addCommand(new RemoveCommand($wrapper_html_id . ' .js-ajax-comments-messages'));
+      $response->addCommand(new RemoveCommand($wrapper_html_id . ' .ajax-comments-form-reply'));
 
       // Build the comment entity form.
       // This approach is very similar to the one taken in
-- 
2.14.3 (Apple Git-98)

