mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-21 23:09:39 +00:00
Fix deeply nested context menus remain open (#399)
* nit - Remove redundant workaround * Fix deeply nested context menus remain open
This commit is contained in:
@@ -332,7 +332,7 @@ export class ContextMenu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
close(e?: MouseEvent, ignore_parent_menu?: boolean): void {
|
close(e?: MouseEvent, ignore_parent_menu?: boolean): void {
|
||||||
this.root.parentNode?.removeChild(this.root)
|
this.root.remove()
|
||||||
if (this.parentMenu && !ignore_parent_menu) {
|
if (this.parentMenu && !ignore_parent_menu) {
|
||||||
this.parentMenu.lock = false
|
this.parentMenu.lock = false
|
||||||
this.parentMenu.current_submenu = null
|
this.parentMenu.current_submenu = null
|
||||||
@@ -360,8 +360,6 @@ export class ContextMenu {
|
|||||||
): CustomEvent {
|
): CustomEvent {
|
||||||
const evt = document.createEvent("CustomEvent")
|
const evt = document.createEvent("CustomEvent")
|
||||||
evt.initCustomEvent(event_name, true, true, params) // canBubble, cancelable, detail
|
evt.initCustomEvent(event_name, true, true, params) // canBubble, cancelable, detail
|
||||||
// @ts-expect-error
|
|
||||||
evt.srcElement = origin
|
|
||||||
if (element.dispatchEvent) element.dispatchEvent(evt)
|
if (element.dispatchEvent) element.dispatchEvent(evt)
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
else if (element.__events) element.__events.dispatchEvent(evt)
|
else if (element.__events) element.__events.dispatchEvent(evt)
|
||||||
|
|||||||
Reference in New Issue
Block a user