Skip to content

Commit ea33ee4

Browse files
committed
Don't use newly estimated height for scroll anchor height in ViewState.update
FIX: Fix an issue where the editor would inappropriately scroll when editing near the bottom of the document with line wrapping enabled, in some cases. Closes codemirror/dev#1552
1 parent 9474894 commit ea33ee4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/viewstate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export class ViewState {
234234
this.scrollAnchorHeight = scrollAnchor.top
235235
} else {
236236
this.scrollAnchorPos = -1
237-
this.scrollAnchorHeight = this.heightMap.height
237+
this.scrollAnchorHeight = prevHeight
238238
}
239239

240240
let viewport = heightChanges.length ? this.mapViewport(this.viewport, update.changes) : this.viewport

0 commit comments

Comments
 (0)