Closed webfrank closed 2 years ago
@webfrank thank u for ur investigation, as you said if left untouched ofc the value it will be null because u need add to default value. try to test using this repl bellow: https://svelte.dev/repl/fa8e6cd0c671439e84eb44bca73fc9e3?version=3.49.0
@webfrank i close this task because get no feedback
Hi, sorry for late feedback. It seems that even if I set the value the first item is not reported as selected.
This is field config:
{
type: 'select',
name: 'kind',
value: 'temperature',
attributes: {
id: 'kind',
label: 'Metric',
classes: ['form-control', 'mb-2']
},
extra: {
options: [
{
value: 'temperature',
title: 'Temperature'
},
{
value: 'humidity',
title: 'Humidity'
},
{
value: 'batteryPercentage',
title: 'Battery'
}
]
}
}
and this is the renderd form
but from the on:update handler I got this:
kind
is supposed to be temperature
but instead is null.
When using a select field, if left untouched, the shown selected item is not really selected (not returned as values) and it is null in the on:update event.