Revert "Ensure the state is a string or an array of strings when initializing the select"

This reverts commit d41a546de2.
This commit is contained in:
Sandro Gehri
2025-09-01 15:14:30 +02:00
parent d41a546de2
commit 29a54443cd
@@ -51,12 +51,6 @@ export class Select {
statePath = null,
onStateChange = () => {},
}) {
if (Array.isArray(state)) {
state = state.map((item) => item.toString())
} else if (state !== null) {
state = state.toString()
}
this.element = element
this.options = options
this.originalOptions = JSON.parse(JSON.stringify(options)) // Keep a copy of original options
@@ -606,7 +600,7 @@ export class Select {
}
// If not found, add to missing values
missingValues.push(value)
missingValues.push(value.toString())
}
}