diff --git a/browser_tests/nodeSearchBox.spec.ts b/browser_tests/nodeSearchBox.spec.ts index 86a0625278..f66d6d807f 100644 --- a/browser_tests/nodeSearchBox.spec.ts +++ b/browser_tests/nodeSearchBox.spec.ts @@ -1,6 +1,17 @@ import { expect } from "@playwright/test"; -import { comfyPageFixture as test} from "./ComfyPage"; +import { ComfyPage, comfyPageFixture } from "./ComfyPage"; +export const test = comfyPageFixture.extend<{ comfyPage: ComfyPage }>({ + comfyPage: async ({ comfyPage }, use) => { + await comfyPage.page.evaluate(async () => { + await window["app"].ui.settings.setSettingValueAsync( + "Comfy.NodeSearchBoxImpl", + "default" + ); + }); + await use(comfyPage); + }, +}); test.describe("Node search box", () => { test("Can trigger on empty canvas double click", async ({ comfyPage }) => { diff --git a/src/scripts/ui.ts b/src/scripts/ui.ts index b45afe28fe..81c6ba20a2 100644 --- a/src/scripts/ui.ts +++ b/src/scripts/ui.ts @@ -429,9 +429,9 @@ export class ComfyUI { options: ["default", "litegraph (legacy)"], defaultValue: "default", onChange: (value?: string) => { + if (value === undefined) return; if (!app.canvas) return; - value = value || "default"; const useLitegraphSearch = value === "litegraph (legacy)"; app.canvas.allow_searchbox = useLitegraphSearch; document.dispatchEvent(