mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-21 21:09:00 +00:00
fix: clamp ContextMenu position against ownerDocument body
Last remaining global `document.body` reference in the positioning block: switch to `ownerDocument.body` so menus opened inside iframes, fullscreen elements, or alternate documents are clamped against the correct viewport.
This commit is contained in:
@@ -213,7 +213,7 @@ export class ContextMenu<TValue = unknown> {
|
||||
left = rect.left + rect.width
|
||||
}
|
||||
|
||||
const body_rect = document.body.getBoundingClientRect()
|
||||
const body_rect = ownerDocument.body.getBoundingClientRect()
|
||||
const root_rect = root.getBoundingClientRect()
|
||||
if (body_rect.height == 0)
|
||||
console.error(
|
||||
|
||||
Reference in New Issue
Block a user