From: Alexander Ebert Date: Mon, 2 Dec 2024 16:53:21 +0000 (+0100) Subject: Do not scroll the editor into view when fixing the cursor X-Git-Tag: 6.1.2_dev_1~7^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=45b4c20b1dc48e5a808fbd47eea164328e3c0187;p=GitHub%2FWoltLab%2FWCF.git Do not scroll the editor into view when fixing the cursor Fixes #6046 --- diff --git a/ts/WoltLabSuite/Core/Acp/Ui/Style/Editor.ts b/ts/WoltLabSuite/Core/Acp/Ui/Style/Editor.ts index 38cb823811..17115b3e9f 100644 --- a/ts/WoltLabSuite/Core/Acp/Ui/Style/Editor.ts +++ b/ts/WoltLabSuite/Core/Acp/Ui/Style/Editor.ts @@ -61,7 +61,7 @@ function handleScss(isTainted: boolean): void { const refreshCodeMirror = (element: any): void => { element.codemirror.refresh(); - element.codemirror.setCursor(element.codemirror.getCursor()); + element.codemirror.setCursor(element.codemirror.getCursor(), undefined, { scroll: false }); }; if (isTainted) { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Style/Editor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Style/Editor.js index 9585102d1d..93f0125f39 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Style/Editor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Style/Editor.js @@ -53,7 +53,7 @@ define(["require", "exports", "tslib", "../../../Ajax", "../../../Core", "../../ const overrideScss = document.getElementById("overrideScss"); const refreshCodeMirror = (element) => { element.codemirror.refresh(); - element.codemirror.setCursor(element.codemirror.getCursor()); + element.codemirror.setCursor(element.codemirror.getCursor(), undefined, { scroll: false }); }; if (isTainted) { EventHandler.add("com.woltlab.wcf.simpleTabMenu_styleTabMenuContainer", "select", () => {