mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-15 04:27:20 +03:00
fix(stats): scroll dense charts to latest data in Safari (#57459)
This commit is contained in:
committed by
GitHub
Unverified
parent
ea982d7d8f
commit
0e82d22d8f
@@ -860,7 +860,8 @@ function isDenseColumnRange(range: UsageRange) {
|
||||
function scrollDenseChartToEnd(element: HTMLDivElement | undefined, range: UsageRange, count: number) {
|
||||
if (!element || count <= 0 || !isDenseColumnRange(range) || typeof window === "undefined") return
|
||||
window.requestAnimationFrame(() => {
|
||||
element.scrollLeft = Number.MAX_SAFE_INTEGER
|
||||
// WebKit ignores out-of-range values like Number.MAX_SAFE_INTEGER, so scroll to the real end.
|
||||
element.scrollLeft = element.scrollWidth
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user