Skip to content

Commit dfc5c34

Browse files
committed
Slider: Switch handles from <a href="#"> to <span tabindex="0">
Fixes #9890 Closes gh-1207
1 parent 343c265 commit dfc5c34

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

demos/slider/multiple-vertical.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<script src="../../ui/slider.js"></script>
1212
<link rel="stylesheet" href="../demos.css">
1313
<style>
14-
#eq span {
14+
#eq > span {
1515
height:120px; float:left; margin:15px
1616
}
1717
</style>

ui/slider.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
8383
var i, handleCount,
8484
options = this.options,
8585
existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
86-
handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
86+
handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
8787
handles = [];
8888

8989
handleCount = ( options.values && options.values.length ) || 1;
@@ -149,11 +149,10 @@ return $.widget( "ui.slider", $.ui.mouse, {
149149
},
150150

151151
_setupEvents: function() {
152-
var elements = this.handles.add( this.range ).filter( "a" );
153-
this._off( elements );
154-
this._on( elements, this._handleEvents );
155-
this._hoverable( elements );
156-
this._focusable( elements );
152+
this._off( this.handles );
153+
this._on( this.handles, this._handleEvents );
154+
this._hoverable( this.handles );
155+
this._focusable( this.handles );
157156
},
158157

159158
_destroy: function() {
@@ -673,9 +672,6 @@ return $.widget( "ui.slider", $.ui.mouse, {
673672

674673
this._slide( event, index, newVal );
675674
},
676-
click: function( event ) {
677-
event.preventDefault();
678-
},
679675
keyup: function( event ) {
680676
var index = $( event.target ).data( "ui-slider-handle-index" );
681677

0 commit comments

Comments
 (0)