diff --git a/bundles/org.openhab.ui.basic/web-src/smarthome.js b/bundles/org.openhab.ui.basic/web-src/smarthome.js index cc7b1b3fba..3b8498c7cf 100644 --- a/bundles/org.openhab.ui.basic/web-src/smarthome.js +++ b/bundles/org.openhab.ui.basic/web-src/smarthome.js @@ -2266,8 +2266,9 @@ if (gradientColors !== "") { _t.slider.style.background = "linear-gradient(to right, " + gradientColors + ")"; } - _t.slider.min = Math.round(min); - _t.slider.max = Math.round(max); + // Extend min/max to integers + _t.slider.min = Math.floor(min); + _t.slider.max = Math.ceil(max); function setCorTemperature(value) { if (isNaN(value)) { @@ -2423,7 +2424,15 @@ _t.modalControl = new Colortemppicker(_t.modal.container, _t.min, _t.max, _t.value, _t.gradientColors, function(valueKelvin) { - emitEvent(valueKelvin); + var + value = valueKelvin; + + if (value < _t.min) { + value = _t.min; + } else if (value > _t.max) { + value = _t.max; + } + emitEvent(value); } );