Skip to content

Commit 0613934

Browse files
authored
Merge pull request #861 from Sysvale/fix/select-model
Fix/select model
2 parents 278ebcb + 47244b4 commit 0613934

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sysvale/cuida",
3-
"version": "3.93.1",
3+
"version": "3.93.2",
44
"description": "A design system built by Sysvale, using storybook and Vue components",
55
"repository": {
66
"type": "git",

src/components/Select.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,10 @@ const id = ref(null);
269269
const allowSearch = ref(false);
270270
const localOptions = ref([]);
271271
const pristineOptions = ref([]);
272-
const localValue = ref({});
272+
const localValue = ref({
273+
value: '',
274+
id: '',
275+
});
273276
const selectElement = ref('');
274277
const direction = ref('down');
275278
const uniqueKey = ref(generateKey());
@@ -328,10 +331,10 @@ watch(() => props.options, (newValue, oldValue) => {
328331
}
329332
}, { immediate: true });
330333
331-
watch(() => model, (newValue, oldValue) => {
334+
watch(model, (newValue, oldValue) => {
332335
if (newValue !== oldValue) {
333336
if (newValue instanceof Object) {
334-
localValue.value = newValue.value;
337+
localValue.value = newValue;
335338
} else {
336339
localValue.value = {id: newValue, value: newValue }
337340
}

0 commit comments

Comments
 (0)