Skip to content

Commit

Permalink
[52] VLSelect: return null on empty string (#53)
Browse files Browse the repository at this point in the history
VLSelect: return null on empty string
  • Loading branch information
AAndonio authored Oct 18, 2024
1 parent 1b60c93 commit 76083df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skillbill/vuelace-3",
"version": "1.1.9",
"version": "1.1.10",
"private": false,
"author": "skillbill",
"license": "MIT",
Expand Down
12 changes: 7 additions & 5 deletions src/components/VLSelect/VLSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ const options_dict = ref<{ [key: string]: string }>({})
const atChange = (evt: SlChangeEvent) => {
const value = (evt.target as SlSelect)?.value
model.value = Array.isArray(value)
? value.map((value) => options_dict.value[value])
: value
? options_dict.value[value]
: undefined
if (Array.isArray(value)) {
model.value = value.map((value) => options_dict.value[value])
} else if (value) {
model.value = options_dict.value[value]
} else {
model.value = null
}
emit('change', evt)
}
Expand Down

0 comments on commit 76083df

Please sign in to comment.