Fix dynamic options with radio groups

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

View File

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