mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Slider: Prevent the default action on keydown if we're listening for the pressed key. Fixes #8109 - Slider: Key handling should prevent scrolling.
(cherry picked from commit 0434bce03d
)
This commit is contained in:
parent
dc12b4d310
commit
470030249c
8
ui/jquery.ui.slider.js
vendored
8
ui/jquery.ui.slider.js
vendored
@ -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" );
|
||||
|
Loading…
Reference in New Issue
Block a user