From d07d1e74780bbc23d7a877e838b2af487b6c974c Mon Sep 17 00:00:00 2001 From: space-nuko <24979496+space-nuko@users.noreply.github.com> Date: Thu, 1 Jun 2023 19:41:18 -0500 Subject: [PATCH] Fix gallery thumbnails bar not scrolling on click Closes #104 --- src/lib/components/ComfyGraphErrorList.svelte | 2 +- src/lib/components/gradio/gallery/Gallery.svelte | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/ComfyGraphErrorList.svelte b/src/lib/components/ComfyGraphErrorList.svelte index 3822ec7..8028093 100644 --- a/src/lib/components/ComfyGraphErrorList.svelte +++ b/src/lib/components/ComfyGraphErrorList.svelte @@ -135,7 +135,7 @@ {#if missingTag && nodeToJumpTo}
Node "{nodeToJumpTo.title}" was missing tag used in workflow:{missingTag}
-
Tags on node: [{(nodeToJumpTo?.attrs?.tags || []).join(", ")}]
+
Tags on node: {(nodeToJumpTo?.properties?.tags || []).join(", ")}
{:else} {error.message} diff --git a/src/lib/components/gradio/gallery/Gallery.svelte b/src/lib/components/gradio/gallery/Gallery.svelte index f6a8108..06a92bc 100644 --- a/src/lib/components/gradio/gallery/Gallery.svelte +++ b/src/lib/components/gradio/gallery/Gallery.svelte @@ -15,7 +15,7 @@ export let label: string; export let root: string = ""; export let root_url: null | string = null; - export let scrollOnUpdate = false; + export let focusOnScroll = false; export let value: Array | Array | null = null; export let style: Styles = { grid_cols: [2], @@ -121,11 +121,11 @@ let container: HTMLDivElement; async function scroll_to_img(index: number | null) { - if (!scrollOnUpdate) return; if (typeof index !== "number") return; await tick(); - el[index].focus(); + if (focusOnScroll) + el[index].focus(); const { left: container_left, width: container_width } = container.getBoundingClientRect();