mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Fix opening search from context menu (#3591)
Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -251,4 +251,17 @@ test.describe('Release context menu', () => {
|
||||
'link-release-context-menu.png'
|
||||
)
|
||||
})
|
||||
|
||||
test('Can search and add node from context menu', async ({
|
||||
comfyPage,
|
||||
comfyMouse
|
||||
}) => {
|
||||
await comfyPage.disconnectEdge()
|
||||
await comfyMouse.move({ x: 10, y: 10 })
|
||||
await comfyPage.clickContextMenuItem('Search')
|
||||
await comfyPage.searchBox.fillAndSelectFirstNode('CLIP Prompt')
|
||||
await expect(comfyPage.canvas).toHaveScreenshot(
|
||||
'link-context-menu-search.png'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -158,7 +158,10 @@ const showContextMenu = (e: CanvasPointerEvent) => {
|
||||
const commonOptions = {
|
||||
e,
|
||||
allow_searchbox: true,
|
||||
showSearchBox: () => showSearchBox(e)
|
||||
showSearchBox: () => {
|
||||
cancelResetOnContextClose()
|
||||
showSearchBox(e)
|
||||
}
|
||||
}
|
||||
const connectionOptions =
|
||||
toType === 'input'
|
||||
@@ -200,7 +203,12 @@ const showContextMenu = (e: CanvasPointerEvent) => {
|
||||
)
|
||||
|
||||
// Reset when the context menu is closed
|
||||
useEventListener(menu.controller.signal, 'abort', reset, options)
|
||||
const cancelResetOnContextClose = useEventListener(
|
||||
menu.controller.signal,
|
||||
'abort',
|
||||
reset,
|
||||
options
|
||||
)
|
||||
}
|
||||
|
||||
// Disable litegraph's default behavior of release link and search box.
|
||||
|
||||
Reference in New Issue
Block a user