diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-02-09 14:00:21 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-02-09 14:00:21 -0500 |
commit | 0434bce03d1368f5ace043fa50e9d4f95677c09e (patch) | |
tree | 252919305a59e10d92b95152ec71d386ed483a77 /ui/jquery.ui.slider.js | |
parent | 518975391ac5d35b9e1b3e4e4a9661c477a5a863 (diff) | |
download | jquery-ui-0434bce03d1368f5ace043fa50e9d4f95677c09e.tar.gz jquery-ui-0434bce03d1368f5ace043fa50e9d4f95677c09e.zip |
Slider: Prevent the default action on keydown if we're listening for the pressed key. Fixes #8109 - Slider: Key handling should prevent scrolling.
Diffstat (limited to 'ui/jquery.ui.slider.js')
-rw-r--r-- | ui/jquery.ui.slider.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js index 9c5d21ffb..aff9093ba 100644 --- a/ui/jquery.ui.slider.js +++ b/ui/jquery.ui.slider.js @@ -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, @@ -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" ); @@ -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" ); |