Skip to content

Commit 0974c45

Browse files
committed
view: only autoscroll if at bottom of container
so we can keep the user from losing his or her place
1 parent 07f3a1f commit 0974c45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ function App(el, currentWindow) {
9898
if (this.activeModel.ele) {
9999
const ele = document.querySelector(this.activeModel.ele)
100100
if (ele) {
101-
ele.scrollTop = ele.scrollHeight
101+
if (ele.scrollHeight - ele.clientHeight <= ele.scrollTop + 1) {
102+
ele.scrollTop = ele.scrollHeight
103+
}
102104
}
103105
} else if (this.activeModel instanceof Settings) {
104106
const ele = document.querySelector('.settings-container')

0 commit comments

Comments
 (0)