Feat: Doubleclick to toggle edit for Markdown (litegraph) (#6560)

## Summary

See https://github.com/Comfy-Org/ComfyUI_frontend/pull/6537, but for
litegraph widget.

Doesn't allow dragging the node through the rendered markdown yet, that
would be more complicated (DOMWidget complication)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6560-Feat-Doubleclick-to-toggle-edit-for-Markdown-litegraph-2a06d73d36508189bf6eedd7cdeba6db)
by [Unito](https://www.unito.io)

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Alexander Brown
2025-11-03 16:28:35 -08:00
committed by GitHub
parent a10c01db4c
commit 4cfa5b4b5d
5 changed files with 31 additions and 34 deletions

View File

@@ -2169,7 +2169,7 @@ export class LGraphCanvas
}
}
processMouseDown(e: PointerEvent): void {
processMouseDown(e: MouseEvent): void {
if (
this.dragZoomEnabled &&
e.ctrlKey &&

View File

@@ -53,14 +53,7 @@ function addMarkdownWidget(
widget.inputEl = inputEl
widget.options.minNodeSize = [400, 200]
inputEl.addEventListener('pointerdown', (event: PointerEvent) => {
if (event.button !== 0) {
app.canvas.processMouseDown(event)
return
}
if (event.target instanceof HTMLAnchorElement) {
return
}
inputEl.addEventListener('dblclick', () => {
inputEl.classList.add('editing')
setTimeout(() => {
textarea.focus()