Widget: Do not prefill field with 0

This commit is contained in:
Raphael Michel
2021-03-16 16:46:39 +01:00
parent 6e2b5eae9a
commit 13056ef477

View File

@@ -229,7 +229,9 @@ Vue.component('availbox', {
},
amount_selected: {
get: function () {
return this.item.has_variations ? this.variation.amount_selected : this.item.amount_selected
var selected = this.item.has_variations ? this.variation.amount_selected : this.item.amount_selected
if (selected === 0) return undefined;
return selected
},
set: function (value) {
// Unary operator to force boolean to integer conversion, as the HTML form submission