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:
Glary-Bot
2026-05-16 03:17:23 +00:00
parent 1e381cccf8
commit 7cfaeb33f8

View File

@@ -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(