Fix downstream extension context menu does not load (#728)

- Adds optional chaining for event target
This commit is contained in:
VeeloxShadow
2025-03-10 08:41:46 +00:00
committed by GitHub
parent 9c60788948
commit acdbbd547e

View File

@@ -139,7 +139,7 @@ export class ContextMenu<TValue = unknown> {
})
// insert before checking position
const ownerDocument = (options.event?.target as Node).ownerDocument
const ownerDocument = (options.event?.target as Node)?.ownerDocument
const root_document = ownerDocument || document
if (root_document.fullscreenElement)