Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/frontend/models/scroll_manager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { onNextEventLoopTick } from "helpers/timing_helpers"

const AUTO_SCROLL_THRESHOLD = 100

export default class ScrollManager {
Expand Down Expand Up @@ -46,7 +44,11 @@ export default class ScrollManager {
const newScrollTop = top ? scrollTop + (this.#container.scrollHeight - scrollHeight) : scrollTop

if (delay) {
requestAnimationFrame(() => this.#container.scrollTo({ top: newScrollTop, behavior: scrollBehaviour }))
requestAnimationFrame(() => {
requestAnimationFrame(() => {
this.#container.scrollTo({ top: newScrollTop, behavior: scrollBehaviour })
})
})
} else {
this.#container.scrollTo({ top: newScrollTop, behavior: scrollBehaviour })
}
Expand Down