mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Slider: Apply tabIndex
to custom handles
This commit is contained in:
parent
c08b621fdb
commit
21bf01acda
@ -25,6 +25,18 @@ QUnit.test( "markup structure", function( assert ) {
|
||||
assert.hasClasses( handle[ 1 ], "ui-slider-handle" );
|
||||
} );
|
||||
|
||||
QUnit.test( "custom handle", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
var element = $( "#slider-custom-handle" ).slider();
|
||||
var customHandle = $( ".custom-handle" );
|
||||
var sliderHandles = element.find( ".ui-slider-handle" );
|
||||
|
||||
assert.equal( sliderHandles.length, 1, "Only one handle" );
|
||||
assert.strictEqual( sliderHandles[ 0 ], customHandle[ 0 ], "Correct handle" );
|
||||
assert.equal( customHandle.attr( "tabIndex" ), 0, "tabIndex" );
|
||||
} );
|
||||
|
||||
QUnit.test( "keydown HOME on handle sets value to min", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
element = $( "<div></div>" );
|
||||
|
@ -25,8 +25,8 @@
|
||||
|
||||
<div id="slider1"></div>
|
||||
<div id="slider2"></div>
|
||||
<div id="slider3" style="position: relative; margin: 40px; width: 217px; height: 28px;">
|
||||
<div class="ui-slider-handle" style="position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px;"></div>
|
||||
<div id="slider-custom-handle">
|
||||
<div class="ui-slider-handle custom-handle"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -117,7 +117,9 @@ return $.widget( "ui.slider", $.ui.mouse, {
|
||||
this.handle = this.handles.eq( 0 );
|
||||
|
||||
this.handles.each( function( i ) {
|
||||
$( this ).data( "ui-slider-handle-index", i );
|
||||
$( this )
|
||||
.data( "ui-slider-handle-index", i )
|
||||
.attr( "tabIndex", 0 );
|
||||
} );
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user