Fix a few svelte bugs with the LinkedRowSelector component to fix adding/editing relationships via a model from the data UI

This commit is contained in:
Andrew Kingston 2023-11-08 14:43:28 +00:00
parent 7672993eae
commit bcf431a476
3 changed files with 9 additions and 4 deletions

View File

@ -64,7 +64,7 @@
</span> </span>
{:else if schema.type === "link"} {:else if schema.type === "link"}
<LinkedRowSelector <LinkedRowSelector
bind:linkedRows={value[field]} linkedRows={value[field]}
{schema} {schema}
on:change={e => onChange(e, field)} on:change={e => onChange(e, field)}
/> />

View File

@ -70,7 +70,12 @@
options={meta.constraints.inclusion} options={meta.constraints.inclusion}
/> />
{:else if type === "link"} {:else if type === "link"}
<LinkedRowSelector {error} bind:linkedRows={value} schema={meta} /> <LinkedRowSelector
{error}
linkedRows={value}
schema={meta}
on:change={e => (value = e.detail)}
/>
{:else if type === "longform"} {:else if type === "longform"}
{#if meta.useRichText} {#if meta.useRichText}
<RichTextField {error} {label} height="150px" bind:value /> <RichTextField {error} {label} height="150px" bind:value />

View File

@ -56,12 +56,12 @@
/> />
{:else} {:else}
<Multiselect <Multiselect
bind:value={linkedIds} value={linkedIds}
{label} {label}
options={rows} options={rows}
getOptionLabel={getPrettyName} getOptionLabel={getPrettyName}
getOptionValue={row => row._id} getOptionValue={row => row._id}
sort sort
on:change={() => dispatch("change", linkedIds)} on:change
/> />
{/if} {/if}