Remove accidental onMouseDown handler (#5405)

* Remove accidental onMouseDown handler

* Fix test snapshot

* Add test that onMouseDown isn't overwritten
This commit is contained in:
AustinMroz
2025-09-06 20:22:59 -07:00
committed by GitHub
parent c2eb4f03e9
commit db37693688
3 changed files with 5 additions and 32 deletions

View File

@@ -743,35 +743,6 @@ export class LGraphNode
error: this.#getErrorStrokeStyle,
selected: this.#getSelectedStrokeStyle
}
// Assign onMouseDown implementation
this.onMouseDown = (
// @ts-expect-error - CanvasPointerEvent type needs fixing
e: CanvasPointerEvent,
pos: Point,
canvas: LGraphCanvas
): boolean => {
// Check for title button clicks (only if not collapsed)
if (this.title_buttons?.length && !this.flags.collapsed) {
// pos contains the offset from the node's position, so we need to use node-relative coordinates
const nodeRelativeX = pos[0]
const nodeRelativeY = pos[1]
for (let i = 0; i < this.title_buttons.length; i++) {
const button = this.title_buttons[i]
if (
button.visible &&
button.isPointInside(nodeRelativeX, nodeRelativeY)
) {
this.onTitleButtonClick(button, canvas)
return true // Prevent default behavior
}
}
}
return false // Allow default behavior
}
// Initialize property manager with tracked properties
this.changeTracker = new LGraphNodeProperties(this)
}