Skip to content

Commit

Permalink
fix:bug preserve default vselect value when undefined (#2311)
Browse files Browse the repository at this point in the history
* preserve default vselect value when undefined

* add check if has option

* let to const variable

* Code style fix

* Code style fix

* Code style fix

---------

Co-authored-by: Quentin Renard <[email protected]>
  • Loading branch information
bwat-dev and ifox authored Jan 16, 2024
1 parent a2c12e7 commit 689aa86
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/js/components/VSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@
},
updateValue: function (value) {
// see formStore mixin
this.value = value
if (!value) {
const allOption = this.options.find((o) => o.value === 'all');
this.value = allOption ?? undefined
} else {
this.value = value
}
this.saveIntoStore()
this.$emit('change', value)
},
Expand Down

0 comments on commit 689aa86

Please sign in to comment.