Do not scroll the editor into view when fixing the cursor
authorAlexander Ebert <ebert@woltlab.com>
Mon, 2 Dec 2024 16:53:21 +0000 (17:53 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 2 Dec 2024 16:53:21 +0000 (17:53 +0100)
Fixes #6046

ts/WoltLabSuite/Core/Acp/Ui/Style/Editor.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Style/Editor.js

index 38cb823811c49f983f070b03357202786aaa2c46..17115b3e9fb2172b7d8414113894a79cf01bf472 100644 (file)
@@ -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) {
index 9585102d1d8fc204cfb474c91bbb2a2b3e44104a..93f0125f39f94c258419e03960696c869f07ca9e 100644 (file)
@@ -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", () => {