diff --git a/src/lib/components/gradio/form/Range.svelte b/src/lib/components/gradio/form/Range.svelte index 0637991..712a292 100644 --- a/src/lib/components/gradio/form/Range.svelte +++ b/src/lib/components/gradio/form/Range.svelte @@ -59,7 +59,7 @@ on:blur={clamp} {step} {disabled} - on:mouseup={handle_release} + on:pointerup={handle_release} /> @@ -73,9 +73,8 @@ max={maximum} {step} {disabled} - on:mouseup={handle_release} + on:pointerup={handle_release} on:pointerdown - on:pointerup on:pointermove /> diff --git a/src/lib/nodes/ComfyActionNodes.ts b/src/lib/nodes/ComfyActionNodes.ts index 2a3290e..4253d34 100644 --- a/src/lib/nodes/ComfyActionNodes.ts +++ b/src/lib/nodes/ComfyActionNodes.ts @@ -161,16 +161,16 @@ export class ComfySwapAction extends ComfyGraphNode { { name: "swap", type: BuiltInSlotType.ACTION } ], outputs: [ - { name: "B", type: "*" }, - { name: "A", type: "*" } + { name: "B", type: BuiltInSlotType.EVENT }, + { name: "A", type: BuiltInSlotType.EVENT } ], } override onAction(action: any, param: any) { const a = this.getInputData(0) const b = this.getInputData(1) - this.setOutputData(0, a) - this.setOutputData(1, b) + this.triggerSlot(0, a) + this.triggerSlot(1, b) }; } diff --git a/src/lib/notify.ts b/src/lib/notify.ts index 3163b9b..82b143d 100644 --- a/src/lib/notify.ts +++ b/src/lib/notify.ts @@ -5,6 +5,9 @@ import { f7 } from "framework7-svelte" let notification; function notifyf7(text: string, title?: string) { + if (!f7) + return; + if (!notification) { notification = f7.notification.create({ title: title, diff --git a/src/lib/widgets/RangeWidget.svelte b/src/lib/widgets/RangeWidget.svelte index 3d7d4df..a19094a 100644 --- a/src/lib/widgets/RangeWidget.svelte +++ b/src/lib/widgets/RangeWidget.svelte @@ -37,6 +37,12 @@ option = value; } + function onRelease(e: Event) { + if (nodeValue && option != null) { + $nodeValue = option + } + } + function setBackgroundSize(input: HTMLInputElement) { input.style.setProperty("--background-size", `${getBackgroundSize(input)}%`); } @@ -54,12 +60,6 @@ setBackgroundSize(target); } - function onRelease(e: Event) { - if (nodeValue && option) { - $nodeValue = option - } - } - let elem: HTMLDivElement = null; $: if (elem) {