Skip to content

Commit

Permalink
Fix a scrolling glitch when the editor is updated before first measure
Browse files Browse the repository at this point in the history
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 codemirror/dev#1366
  • Loading branch information
marijnh committed Apr 11, 2024
1 parent ddfda56 commit 93db37d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/viewstate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 93db37d

Please sign in to comment.