Skip to content

Lightweight server monitoring with historical data, docker stats, and alerts.

refactor(ui): measure y-axis labels via textContent instead of innerHTML (#2536)

Marrrrrrrrrya1d86d120fa0
diff --git a/internal/site/src/components/charts/hooks.ts b/internal/site/src/components/charts/hooks.ts
index 0a99eaa23..c97610f15 100644
--- a/internal/site/src/components/charts/hooks.ts
+++ b/internal/site/src/components/charts/hooks.ts
@@ -103,7 +103,7 @@ export function useYAxisWidth() {
maxChars = str.length
const div = document.createElement("div")
div.className = "text-xs tabular-nums tracking-tighter table sr-only"
- div.innerHTML = str
+ div.textContent = str
clearTimeout(timeout)
timeout = setTimeout(() => {
document.body.appendChild(div)