mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix initial data for select selector without labels (#17659)
This commit is contained in:
parent
216a3c4c7e
commit
3534617f81
@ -60,7 +60,8 @@ export const computeInitialHaFormData = (
|
||||
data[field.name] = selector.number?.min ?? 0;
|
||||
} else if ("select" in selector) {
|
||||
if (selector.select?.options.length) {
|
||||
data[field.name] = selector.select.options[0][0];
|
||||
const val = selector.select.options[0];
|
||||
data[field.name] = Array.isArray(val) ? val[0] : val;
|
||||
}
|
||||
} else if ("duration" in selector) {
|
||||
data[field.name] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user