diff --git a/src/pretix/static/pretixpresale/js/widget/widget.js b/src/pretix/static/pretixpresale/js/widget/widget.js index e1edb677c6..93f74ff632 100644 --- a/src/pretix/static/pretixpresale/js/widget/widget.js +++ b/src/pretix/static/pretixpresale/js/widget/widget.js @@ -1171,15 +1171,27 @@ Vue.component('pretix-widget-event-form', { Vue.component('pretix-widget-event-list-filter-field', { template: ('
'), props: { field: Object }, + data: function() { + return { + valueOnFocus: "" + } + }, methods: { + onFocus: function (event) { + this.valueOnFocus = this.$refs.select.value; + }, onChange: function(event) { + if (this.valueOnFocus == this.$refs.select.value) { + // no change + return; + } var filterParams = new URLSearchParams(this.$root.filter); if (event.target.value) { filterParams.set(this.field.key, event.target.value); @@ -1190,6 +1202,14 @@ Vue.component('pretix-widget-event-list-filter-field', { this.$root.loading++; this.$root.reload(); }, + onKeydown: function (e) { + const keyDown = e.key !== undefined ? e.key : e.keyCode; + if ( (keyDown === 'Enter' || keyDown === 13) || (['Spacebar', ' '].indexOf(keyDown) >= 0 || keyDown === 32)) { + // (prevent default so the page doesn't scroll when pressing space) + e.preventDefault(); + this.onChange(e); + } + }, }, computed: { id: function () {