Fix gallery thumbnails bar not scrolling on click

Closes #104
This commit is contained in:
space-nuko
2023-06-01 19:41:18 -05:00
parent 4923a78d7c
commit d07d1e7478
2 changed files with 4 additions and 4 deletions

View File

@@ -135,7 +135,7 @@
{#if missingTag && nodeToJumpTo}
<div class="error-input">
<div><span class="error-message">Node "{nodeToJumpTo.title}" was missing tag used in workflow:</span><span style:padding-left="0.2rem"><b>{missingTag}</b></span></div>
<div>Tags on node: <b>[{(nodeToJumpTo?.attrs?.tags || []).join(", ")}]</b></div>
<div>Tags on node: <b>{(nodeToJumpTo?.properties?.tags || []).join(", ")}</b></div>
</div>
{:else}
<span class="error-message" class:execution-error={isExecutionError}>{error.message}</span>

View File

@@ -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<string> | Array<FileData> | 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();