Slider: trim to max and min on UP DOWN LEFT RIGHT. Fixed #5591 - Slider: can go outside min and max with keyboard

This commit is contained in:
Richard D. Worth 2010-05-11 08:36:56 -04:00
parent 5fd158053f
commit 114c001aba

View File

@ -191,14 +191,14 @@ $.widget( "ui.slider", $.ui.mouse, {
if ( curVal === self._valueMax() ) { if ( curVal === self._valueMax() ) {
return; return;
} }
newVal = curVal + step; newVal = self._trimAlignValue( curVal + step );
break; break;
case $.ui.keyCode.DOWN: case $.ui.keyCode.DOWN:
case $.ui.keyCode.LEFT: case $.ui.keyCode.LEFT:
if ( curVal === self._valueMin() ) { if ( curVal === self._valueMin() ) {
return; return;
} }
newVal = curVal - step; newVal = self._trimAlignValue( curVal - step );
break; break;
} }