Skip to content

Commit c3e9f01

Browse files
authored
Merge pull request #994 from Sysvale/fix/improves-usability-select-and-combobox
Fix/improves usability select and combobox
2 parents b7f46ff + 3cb3337 commit c3e9f01

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
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.137.2",
3+
"version": "3.137.3",
44
"description": "A design system built by Sysvale, using storybook and Vue components",
55
"repository": {
66
"type": "git",

src/components/Select.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,14 @@ function activateSelectionOnEnter() {
428428
resetActiveSelection();
429429
430430
if (typeof localOptions.value[currentPos.value] === 'undefined') {
431-
localValue.value = cloneDeep(localOptions.value[0]);
431+
handleAddOption();
432+
433+
nextTick(() => {
434+
localValue.value = props.searchable && props.addable
435+
? localValue.value
436+
: cloneDeep(localOptions.value[0]);
437+
});
438+
432439
} else {
433440
localValue.value = cloneDeep(localOptions.value[currentPos.value]);
434441
}
@@ -462,10 +469,13 @@ function hide() {
462469
: {};
463470
}
464471
465-
localOptions.value = pristineOptions.value;
466-
searchString.value = '';
467-
baseInputControl.value += 1;
468-
active.value = false;
472+
nextTick(() => {
473+
localOptions.value = pristineOptions.value;
474+
searchString.value = '';
475+
baseInputControl.value += 1;
476+
active.value = false;
477+
});
478+
469479
emitBlur();
470480
}
471481

0 commit comments

Comments
 (0)