fix: auto-select bug (#59)

This commit is contained in:
Hayden 2022-10-13 16:45:18 -08:00 committed by GitHub
parent ae73b194c4
commit 889197994b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 38 deletions

View file

@ -30,6 +30,13 @@
return;
}
if (locations) {
const location = locations.value.find(l => l.id === data.location.id);
if (location) {
data.location = location;
}
}
return data;
});
onMounted(() => {
@ -308,7 +315,7 @@
</template>
</BaseSectionHeader>
<div class="px-5 mb-6 grid md:grid-cols-2 gap-4">
<FormSelect v-model="item.location" label="Location" :items="locations ?? []" select-first />
<FormSelect v-if="item" v-model="item.location" label="Location" :items="locations ?? []" />
<FormMultiselect v-model="item.labels" label="Labels" :items="labels ?? []" />
</div>