Skip to content

Commit aabc6dd

Browse files
committed
Reset native scrollbar when hiding it
To avoid it reinitializing in a scrolled position on Chrome Issue codemirror#6819
1 parent f9826b4 commit aabc6dd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/display/scrollbars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class NativeScrollbars {
6060
this.vert.firstChild.style.height =
6161
Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"
6262
} else {
63+
this.vert.scrollTop = 0
6364
this.vert.style.display = ""
6465
this.vert.firstChild.style.height = "0"
6566
}

0 commit comments

Comments
 (0)