From 93db37db14103ee6b9afed0227cdc299456a6af8 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 11 Apr 2024 16:51:42 +0200 Subject: [PATCH] Fix a scrolling glitch when the editor is updated before first measure FIX: Fix an issue where dispatching an update to an editor before it measured itself for the first time could cause the scroll position to incorrectly move. Closes https://github.com/codemirror/dev/issues/1366 --- src/viewstate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viewstate.ts b/src/viewstate.ts index 42c3dcf..d1dcacb 100644 --- a/src/viewstate.ts +++ b/src/viewstate.ts @@ -114,7 +114,7 @@ export class ViewState { editorHeight = 0 // scrollDOM.clientHeight, unscaled editorWidth = 0 // scrollDOM.clientWidth, unscaled scrollTop = 0 // Last seen scrollDOM.scrollTop, scaled - scrolledToBottom = true + scrolledToBottom = false // The CSS-transformation scale of the editor (transformed size / // concrete size) scaleX = 1