Skip to content

Commit

Permalink
Slider: Prevent the default action on keydown if we're listening for …
Browse files Browse the repository at this point in the history
…the pressed key. Fixes #8109 - Slider: Key handling should prevent scrolling.

(cherry picked from commit 0434bce)
  • Loading branch information
scottgonzalez committed Feb 9, 2012
1 parent dc12b4d commit 4700302
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ui/jquery.ui.slider.js
Expand Up @@ -115,8 +115,7 @@ $.widget( "ui.slider", $.ui.mouse, {

this.handles
.keydown(function( event ) {
var ret = true,
index = $( this ).data( "index.ui-slider-handle" ),
var index = $( this ).data( "index.ui-slider-handle" ),
allowed,
curVal,
newVal,
Expand All @@ -135,7 +134,7 @@ $.widget( "ui.slider", $.ui.mouse, {
case $.ui.keyCode.RIGHT:
case $.ui.keyCode.DOWN:
case $.ui.keyCode.LEFT:
ret = false;
event.preventDefault();
if ( !self._keySliding ) {
self._keySliding = true;
$( this ).addClass( "ui-state-active" );
Expand Down Expand Up @@ -184,9 +183,6 @@ $.widget( "ui.slider", $.ui.mouse, {
}

self._slide( event, index, newVal );

return ret;

})
.keyup(function( event ) {
var index = $( this ).data( "index.ui-slider-handle" );
Expand Down

0 comments on commit 4700302

Please sign in to comment.