Fix react button in additional loaded comments
authorMarcel Werk <burntime@woltlab.com>
Wed, 17 Jan 2024 16:10:32 +0000 (17:10 +0100)
committerOlaf Braun <info@braun-development.de>
Thu, 7 Mar 2024 15:36:30 +0000 (16:36 +0100)
Closes #5762

ts/WoltLabSuite/Core/Component/Comment/List.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Component/Comment/List.js

index e8e3b5274484a2028737166072fbcdd5d88d9ce8..b50bacebaa94e188294707fab85ce51c5a120e4c 100644 (file)
@@ -320,6 +320,7 @@ class CommentList {
     comment
       .querySelector(".commentResponseList")!
       .insertBefore(fragment, comment.querySelector(".commentLoadNextResponses"));
+    DomChangeListener.trigger();
 
     comment.dataset.lastResponseTime = response.lastResponseTime.toString();
     comment.dataset.lastResponseId = response.lastResponseID.toString();
@@ -370,6 +371,7 @@ class CommentList {
     this.#container
       .querySelector(".commentList")!
       .insertBefore(fragment, this.#container.querySelector(".commentLoadNext"));
+    DomChangeListener.trigger();
 
     this.#container.dataset.lastCommentTime = response.lastCommentTime.toString();
 
index 7c4ecb9efb13478a07968b345864327da6b56b94..8d3282e78a42db50bd4082f5050e54709bd637f9 100644 (file)
@@ -240,6 +240,7 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Dom/Change/Listener"
             comment
                 .querySelector(".commentResponseList")
                 .insertBefore(fragment, comment.querySelector(".commentLoadNextResponses"));
+            Listener_1.default.trigger();
             comment.dataset.lastResponseTime = response.lastResponseTime.toString();
             comment.dataset.lastResponseId = response.lastResponseID.toString();
             this.#initLoadNextResponses(comment);
@@ -280,6 +281,7 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Dom/Change/Listener"
             this.#container
                 .querySelector(".commentList")
                 .insertBefore(fragment, this.#container.querySelector(".commentLoadNext"));
+            Listener_1.default.trigger();
             this.#container.dataset.lastCommentTime = response.lastCommentTime.toString();
             if (this.#displayedComments < this.#totalComments) {
                 button.disabled = false;