Fix clamp undefined min/max

This commit is contained in:
Rob Garrison 2018-09-18 07:45:53 -05:00
parent 375e0ec448
commit 7fff670683

View File

@ -328,9 +328,8 @@ function configDialog(style) {
// Clamp input[type=number] to a valid range
function clampValue(value, va) {
const min = typeof va.min === 'undefined' ? 0 : va.min;
const max = typeof va.max === 'undefined' ? 100 : va.max;
if (value < min) {
const max = isNumber(va.max) ? va.max : 100;
if (isNumber(va.min) && value < va.min) {
return min;
}
if (value > max) {