Fix dynamic options with radio groups

This commit is contained in:
Andrew Kingston 2021-08-17 14:15:48 +01:00
parent e222cd6452
commit ef99355a93
1 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<script> <script>
import { CoreSelect, RadioGroup } from "@budibase/bbui" import { CoreSelect, CoreRadioGroup } from "@budibase/bbui"
import Field from "./Field.svelte" import Field from "./Field.svelte"
export let field export let field
@ -87,13 +87,15 @@
getOptionValue={flatOptions ? x => x : x => x.value} getOptionValue={flatOptions ? x => x : x => x.value}
/> />
{:else if optionsType === "radio"} {:else if optionsType === "radio"}
<RadioGroup <CoreRadioGroup
value={$fieldState.value} value={$fieldState.value}
id={$fieldState.fieldId} id={$fieldState.fieldId}
disabled={$fieldState.disabled} disabled={$fieldState.disabled}
error={$fieldState.error} error={$fieldState.error}
options={fieldSchema?.constraints?.inclusion ?? []} {options}
on:change={e => fieldApi.setValue(e.detail)} on:change={e => fieldApi.setValue(e.detail)}
getOptionLabel={flatOptions ? x => x : x => x.label}
getOptionValue={flatOptions ? x => x : x => x.value}
/> />
{/if} {/if}
{/if} {/if}