Trigger searchbox on group body db click (#731)

This commit is contained in:
Chenlei Hu
2024-09-04 10:16:12 -04:00
committed by GitHub
parent ada8500d21
commit b396d1a9fe
3 changed files with 46 additions and 0 deletions

View File

@@ -164,6 +164,15 @@ const canvasEventHandler = (e: LiteGraphCanvasEvent) => {
showSearchBox(e)
} else if (e.detail.subType === 'empty-release') {
handleCanvasEmptyRelease(e)
} else if (e.detail.subType === 'group-double-click') {
const group = e.detail.group
const [x, y] = group.pos
// @ts-expect-error LiteGraphCanvasEvent is not typed
const relativeY = e.detail.originalEvent.canvasY - y
// Show search box if the click is NOT on the title bar
if (relativeY > group.titleHeight) {
showSearchBox(e)
}
}
}