@samitouri / QOSami-HFS / commits / 145d5334

fix: file-menu is misplaced if there's "uploader" info

Massimo Melina committed Feb 25, 2025 at 21:04 UTC 145d5334c37f55ee9a05daa79a47817330b09d1a
1 file changed +7 -2
shared/dialogs.ts
+7 -2
@@ -121,8 +121,13 @@ function Dialog(d: DialogOptions) {
121 if (!el) return
122 tabCycle(el) // focus first thing inside dialog. This makes JAWS behave
123 if (!d.position) return
124 - const rect = el.getBoundingClientRect()
125 - setShiftY(Math.min(0, rect.top, window.innerHeight - rect.bottom))
124 + // not the nicest of solutions, but short, effective, and used only by short-lived context menus
125 + let y = 0
126 + const t = setInterval(() => {
127 + const rect = el.getBoundingClientRect()
128 + setShiftY(y = Math.min(y, rect.top, window.innerHeight - rect.bottom + y))
129 + }, 100)
130 + return () => clearInterval(t)
131 }, [])
132 d = { closable: true, ...dialogsDefaults, ...d }
133 if (d.Container)