diff --git a/src/lib/litegraph/src/LGraphCanvas.ts b/src/lib/litegraph/src/LGraphCanvas.ts index 5c5546117..044fad131 100644 --- a/src/lib/litegraph/src/LGraphCanvas.ts +++ b/src/lib/litegraph/src/LGraphCanvas.ts @@ -7073,22 +7073,20 @@ export class LGraphCanvas implements CustomEventDispatcher const defaultY = rect.top + rect.height * 0.5 const safeEvent = event ?? - Object.assign( - new MouseEvent('click', { - clientX: rect.left + rect.width * 0.5, - clientY: defaultY - }), - { layerY: defaultY } // layerY is a nonstandard property used below - ) + new MouseEvent('click', { + clientX: rect.left + rect.width * 0.5, + clientY: defaultY + }) const left = safeEvent.clientX - 80 const top = safeEvent.clientY - 20 dialog.style.left = `${left}px` dialog.style.top = `${top}px` - // To avoid out of screen problems - if (safeEvent.layerY > rect.height - 200) { - helper.style.maxHeight = `${rect.height - safeEvent.layerY - 20}px` + // To avoid out of screen problems - derive layerY from clientY + const safeLayerY = event?.layerY ?? safeEvent.clientY - rect.top + if (safeLayerY > rect.height - 200) { + helper.style.maxHeight = `${rect.height - safeLayerY - 20}px` } requestAnimationFrame(function () { input.focus() diff --git a/src/lib/litegraph/src/node/NodeSlot.test.ts b/src/lib/litegraph/src/node/NodeSlot.test.ts index 924769beb..4d7d4b8ea 100644 --- a/src/lib/litegraph/src/node/NodeSlot.test.ts +++ b/src/lib/litegraph/src/node/NodeSlot.test.ts @@ -13,7 +13,7 @@ import type { ReadOnlyRect } from '@/lib/litegraph/src/interfaces' const boundingRect: ReadOnlyRect = [0, 0, 10, 10] describe('NodeSlot', () => { - describe('inputAsSerialisable', () => { + describe('outputAsSerialisable', () => { it('removes _data from serialized slot', () => { const slot: INodeOutputSlot & { _data: string } = { _data: 'test data', diff --git a/src/platform/settings/types.ts b/src/platform/settings/types.ts index 99c394b41..e25986d42 100644 --- a/src/platform/settings/types.ts +++ b/src/platform/settings/types.ts @@ -49,15 +49,15 @@ export interface SettingParams extends FormItem { hideInVueNodes?: boolean } -/** - * The base form item for rendering in a form. - */ /** * Legacy options function type for dynamic options. * @deprecated Use static options array instead. */ type LegacyOptionsFunction = (value: unknown) => Array +/** + * The base form item for rendering in a form. + */ export interface FormItem { name: string type: SettingInputType | SettingCustomRenderer diff --git a/src/scripts/domWidget.ts b/src/scripts/domWidget.ts index aa0b8dd14..0e83ee777 100644 --- a/src/scripts/domWidget.ts +++ b/src/scripts/domWidget.ts @@ -211,6 +211,7 @@ abstract class BaseDOMWidgetImpl } override createCopyForNode(node: LGraphNode): this { + // Safe: subclasses override getCloneArgs to return constructor-compatible args const Ctor = this.constructor as new (args: Record) => this const cloned = new Ctor(this.getCloneArgs(node)) cloned.value = this.value diff --git a/src/scripts/ui/draggableList.ts b/src/scripts/ui/draggableList.ts index e0853486c..3a523fdd2 100644 --- a/src/scripts/ui/draggableList.ts +++ b/src/scripts/ui/draggableList.ts @@ -166,8 +166,10 @@ export class DraggableList extends EventTarget { } initItemsState() { + const draggable = this.draggableItem + if (!draggable) return this.getIdleItems().forEach((item, i) => { - if (this.getAllItems().indexOf(this.draggableItem!) > i) { + if (this.getAllItems().indexOf(draggable) > i) { item.dataset.isAbove = '' } }) diff --git a/src/scripts/ui/imagePreview.ts b/src/scripts/ui/imagePreview.ts index e209a5470..d70c4646d 100644 --- a/src/scripts/ui/imagePreview.ts +++ b/src/scripts/ui/imagePreview.ts @@ -73,7 +73,7 @@ export function createImageHost(node: LGraphNode) { } el.style.setProperty('--comfy-widget-min-height', elH.toString()) } else { - el.style.setProperty('--comfy-widget-min-height', null) + el.style.removeProperty('--comfy-widget-min-height') } const nw = node.size[0] diff --git a/src/types/workflowSchemaTypes.ts b/src/types/workflowSchemaTypes.ts index 9f28307d5..20cbe650e 100644 --- a/src/types/workflowSchemaTypes.ts +++ b/src/types/workflowSchemaTypes.ts @@ -9,6 +9,5 @@ import type { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/w * ISerialisedGraph is the LiteGraph serialization format. * * TODO: Align these schemas to eliminate the need for this cast. - * @see https://github.com/Comfy-Org/ComfyUI_frontend/issues/XXXX */ export type WorkflowAsGraph = ComfyWorkflowJSON & ISerialisedGraph