mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Fix spin-buttons when no max-attribute present (Z#23122239) (#3317)
This commit is contained in:
committed by
GitHub
parent
4678cef32a
commit
e7d6bfd8b1
@@ -122,7 +122,7 @@ var form_handlers = function (el) {
|
||||
var step = parseFloat(this.getAttribute("data-step"));
|
||||
var controls = document.getElementById(this.getAttribute("data-controls"));
|
||||
var currentValue = parseFloat(controls.value);
|
||||
controls.value = Math.max(controls.min, Math.min(controls.max, (currentValue || 0) + step));
|
||||
controls.value = Math.max(controls.min, Math.min(controls.max || Number.MAX_SAFE_INTEGER, (currentValue || 0) + step));
|
||||
controls.dispatchEvent(new Event("change"));
|
||||
});
|
||||
|
||||
|
||||
@@ -317,7 +317,7 @@ Vue.component('availbox', {
|
||||
var t = e.target.tagName == 'BUTTON' ? e.target : e.target.closest('button');
|
||||
var step = parseFloat(t.getAttribute("data-step"));
|
||||
var controls = document.getElementById(t.getAttribute("data-controls"));
|
||||
this.amount_selected = Math.max(controls.min, Math.min(controls.max, (this.amount_selected || 0) + step));
|
||||
this.amount_selected = Math.max(controls.min, Math.min(controls.max || Number.MAX_SAFE_INTEGER, (this.amount_selected || 0) + step));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user