Skip to content

Commit 7609bc5

Browse files
committed
fix groups with a null option
1 parent d6ef91e commit 7609bc5

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

demo/components/demo-vf-smart-select.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</div>
88

99
<div>
10-
<VfSmartSelect v-model="selectedOption" :options="options" label-field="label" group-field="group" />
10+
<VfSmartSelect v-model="selectedOption" :options="options" label-field="label" group-field="group" null-title="No selection" />
1111

1212
Selected value: {{ selectedOption?.label ?? '-' }}
1313
</div>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@signal24/vue-foundation",
33
"type": "module",
4-
"version": "4.25.0",
4+
"version": "4.25.1",
55
"description": "Common components, directives, and helpers for Vue 3 apps",
66
"module": "./dist/vue-foundation.es.js",
77
"exports": {

src/components/vf-smart-select.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const effectiveOptions = computed(() => {
227227
});
228228
229229
const groupedOptions = computed(() => {
230-
if (!effectiveOptions.value[0]?.group) {
230+
if (!isGrouped.value) {
231231
return [
232232
{
233233
groupTitle: '',
@@ -237,7 +237,7 @@ const groupedOptions = computed(() => {
237237
}
238238
239239
const groupTitles = uniq(effectiveOptions.value.map(option => option.group ?? ''));
240-
const groupedOptions = groupBy(effectiveOptions.value, option => option.group);
240+
const groupedOptions = groupBy(effectiveOptions.value, option => option.group ?? '');
241241
return groupTitles.map(groupTitle => ({
242242
groupTitle,
243243
options: groupedOptions[groupTitle!]

0 commit comments

Comments
 (0)