Fix nullish values in RecordSelector
This commit is contained in:
parent
a5a7ba68e3
commit
f1696e08ea
|
@ -3,10 +3,13 @@
|
||||||
import { Input, Select, Label } from "@budibase/bbui"
|
import { Input, Select, Label } from "@budibase/bbui"
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
$: value = value || {}
|
|
||||||
$: model = $backendUiStore.models.find(model => model._id === value?.modelId)
|
$: model = $backendUiStore.models.find(model => model._id === value?.modelId)
|
||||||
$: schemaFields = Object.entries(model?.schema ?? {})
|
$: schemaFields = Object.entries(model?.schema ?? {})
|
||||||
|
|
||||||
|
// Ensure any nullish modelId values get set to empty string so
|
||||||
|
// that the select works
|
||||||
|
$: if (value?.modelId == null) value = { modelId: "" }
|
||||||
|
|
||||||
function setParsedValue(evt, field) {
|
function setParsedValue(evt, field) {
|
||||||
const fieldSchema = model?.schema[field]
|
const fieldSchema = model?.schema[field]
|
||||||
if (fieldSchema) {
|
if (fieldSchema) {
|
||||||
|
|
Loading…
Reference in New Issue