Fix the position of the error message for replies
authorAlexander Ebert <ebert@woltlab.com>
Thu, 6 Apr 2023 14:18:03 +0000 (16:18 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 6 Apr 2023 14:18:03 +0000 (16:18 +0200)
Fixes #5401

ts/WoltLabSuite/Core/Ui/Message/Reply.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Reply.js

index f195f438cb39eb597dde49e41632a0d942cec1a1..e8a915958d79e2e9609963ad0ef295f2fff83111 100644 (file)
@@ -216,7 +216,7 @@ class UiMessageReply {
     // check if editor contains actual content
     const message = this._getCKEditor().getHtml();
     if (message === "") {
-      this.throwError(this._textarea, Language.get("wcf.global.form.error.empty"));
+      this.throwError(this._getCKEditor().element, Language.get("wcf.global.form.error.empty"));
       return false;
     }
 
@@ -287,7 +287,7 @@ class UiMessageReply {
     EventHandler.fire("com.woltlab.wcf.ckeditor5", "handleError_text", parameters);
 
     if (!parameters.cancel) {
-      this.throwError(this._textarea, data.returnValues.realErrorMessage);
+      this.throwError(this._getCKEditor().element, data.returnValues.realErrorMessage);
     }
   }
 
index eb80e1f04696205c6cdd799629bccaa034414a53..cb9030319bb462678c33158d3edaddc26a2a7f81 100644 (file)
@@ -162,7 +162,7 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Core", "../../Event/
             // check if editor contains actual content
             const message = this._getCKEditor().getHtml();
             if (message === "") {
-                this.throwError(this._textarea, Language.get("wcf.global.form.error.empty"));
+                this.throwError(this._getCKEditor().element, Language.get("wcf.global.form.error.empty"));
                 return false;
             }
             const data = {
@@ -222,7 +222,7 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Core", "../../Event/
             };
             EventHandler.fire("com.woltlab.wcf.ckeditor5", "handleError_text", parameters);
             if (!parameters.cancel) {
-                this.throwError(this._textarea, data.returnValues.realErrorMessage);
+                this.throwError(this._getCKEditor().element, data.returnValues.realErrorMessage);
             }
         }
         /**