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>
{:else if schema.type === "link"}
<LinkedRowSelector
bind:linkedRows={value[field]}
linkedRows={value[field]}
{schema}
on:change={e => onChange(e, field)}
/>

View File

@ -70,7 +70,12 @@
options={meta.constraints.inclusion}
/>
{: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"}
{#if meta.useRichText}
<RichTextField {error} {label} height="150px" bind:value />

View File

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