Skip to content

Commit 159a21a

Browse files
committed
Fix double scrolling when replying to a comment
Closes #5991
1 parent abb61bf commit 159a21a

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

ts/WoltLabSuite/Core/Component/Comment/Add.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class CommentAdd {
7979
#focusEditor(): void {
8080
window.setTimeout(() => {
8181
UiScroll.element(this.#container, () => {
82-
this.#getEditor().focus();
82+
this.#getEditor().focus(false);
8383
});
8484
}, 0);
8585
}

ts/WoltLabSuite/Core/Component/Comment/Response/Add.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,9 @@ export class CommentResponseAdd {
6565
this.#messageCache.set(this.#commentId, this.#getContent());
6666
}
6767

68+
this.container.hidden = false;
6869
this.#setContent(this.#messageCache.get(commentId) || "");
6970
this.#commentId = commentId;
70-
71-
this.container.hidden = false;
7271
}
7372

7473
/**
@@ -191,7 +190,7 @@ export class CommentResponseAdd {
191190
* Sets the content and places the caret at the end of the editor.
192191
*/
193192
#setContent(html: string): void {
194-
this.#getEditor().setHtml(html);
193+
this.#getEditor().setHtml(html, false);
195194

196195
// the error message can appear anywhere in the container, not exclusively after the textarea
197196
const innerError = this.#textarea.parentElement!.querySelector(".innerError");
@@ -208,7 +207,7 @@ export class CommentResponseAdd {
208207
#focusEditor(): void {
209208
window.setTimeout(() => {
210209
UiScroll.element(this.container, () => {
211-
this.#getEditor().focus();
210+
this.#getEditor().focus(false);
212211
});
213212
}, 0);
214213
}

wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wcfsetup/install/files/js/WoltLabSuite/Core/Component/Comment/Add.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wcfsetup/install/files/js/WoltLabSuite/Core/Component/Comment/Response/Add.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)