From 13056ef4772f13adb56c14096d3daf688a9e47e6 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 16 Mar 2021 16:46:39 +0100 Subject: [PATCH] Widget: Do not prefill field with 0 --- src/pretix/static/pretixpresale/js/widget/widget.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pretix/static/pretixpresale/js/widget/widget.js b/src/pretix/static/pretixpresale/js/widget/widget.js index 492842c19a..6c8a39fbe1 100644 --- a/src/pretix/static/pretixpresale/js/widget/widget.js +++ b/src/pretix/static/pretixpresale/js/widget/widget.js @@ -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