Skip to content

Commit

Permalink
fix(combo box): set filter correctly for inital value
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnixon committed Mar 22, 2022
1 parent 250841c commit f43a0b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/components/cv-combo-box/cv-combo-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export default {
this.updateOptions();
},
mounted() {
this.filter = this.value;
this.internalUpdateValue(this.value);
this.highlighted = this.value ? this.value : this.highlight; // override highlight with value if provided
this.checkSlots();
},
Expand Down
3 changes: 2 additions & 1 deletion storybook/stories/cv-combo-box-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ for (const story of storySet) {
story.name,
() => {
const settings = story.knobs();
const defaultValue = story.name === 'vModel' ? 'val-mango' : '';

const templateString = `<cv-combo-box ${settings.group.attr}
:options="options">${settings.group.slots}
Expand Down Expand Up @@ -224,7 +225,7 @@ for (const story of storySet) {
props: settings.props,
data() {
return {
value: '',
value: defaultValue,
options: fruits,
highlight: '',
};
Expand Down

0 comments on commit f43a0b9

Please sign in to comment.