Skip to content

Commit 145a438

Browse files
committed
Selectmenu: Do not copy accesskey attributes
1 parent 940d7ec commit 145a438

File tree

2 files changed

+3
-30
lines changed

2 files changed

+3
-30
lines changed

tests/unit/selectmenu/selectmenu_core.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,10 @@ module( "selectmenu: core" );
44

55
asyncTest( "accessibility", function() {
66
var links, button, menu,
7-
element = $( "#speed" )
8-
.attr({
9-
accesskey: "s",
10-
title: "A demo title"
11-
});
7+
element = $( "#speed" ).attr( "title", "A demo title" );
128

139
element.find( "option" ).each(function( index ) {
14-
$( this ).attr({
15-
accesskey: index,
16-
title: "A demo title #" + index
17-
});
10+
$( this ).attr( "title", "A demo title #" + index );
1811
});
1912

2013
element.selectmenu();
@@ -24,7 +17,7 @@ asyncTest( "accessibility", function() {
2417
button.simulate( "focus" );
2518
links = menu.find( "li.ui-menu-item" );
2619

27-
expect( 15 + links.length * 4 );
20+
expect( 13 + links.length * 3 );
2821

2922
setTimeout(function() {
3023
equal( button.attr( "role" ), "combobox", "button role" );
@@ -38,8 +31,6 @@ asyncTest( "accessibility", function() {
3831
"button link aria-labelledby"
3932
);
4033
equal( button.attr( "tabindex" ), 0, "button link tabindex" );
41-
ok( !element.attr( "accesskey" ), "element accesskey" );
42-
equal( button.attr( "accesskey" ), "s", "button accesskey" );
4334
equal( button.attr( "title" ), "A demo title", "button title" );
4435

4536
equal( menu.attr( "role" ), "listbox", "menu role" );
@@ -55,7 +46,6 @@ asyncTest( "accessibility", function() {
5546
var link = $( this );
5647
equal( link.attr( "role" ), "option", "menu link #" + index +" role" );
5748
equal( link.attr( "tabindex" ), -1, "menu link #" + index +" tabindex" );
58-
equal( link.attr( "accesskey" ), index, "menu link #" + index + " accesskey" );
5949
equal( link.attr( "title" ), "A demo title #" + index, "menu link #" + index + " title" );
6050
});
6151
start();

ui/selectmenu.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ return $.widget( "ui.selectmenu", {
110110
this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
111111
this._resizeButton();
112112

113-
this.accesskey = this.element.attr( "accesskey" );
114-
if ( this.accesskey ) {
115-
this.button.attr( "accesskey", this.accesskey );
116-
this.element.removeAttr( "accesskey" );
117-
}
118-
119113
this._on( this.button, this._buttonEvents );
120114
this.button.one( "focusin", function() {
121115

@@ -303,7 +297,6 @@ return $.widget( "ui.selectmenu", {
303297

304298
_renderItem: function( ul, item ) {
305299
var li = $( "<li>", {
306-
accesskey: item.accesskey,
307300
title: item.element.attr( "title" )
308301
});
309302

@@ -564,11 +557,9 @@ return $.widget( "ui.selectmenu", {
564557
index: index,
565558
value: option.attr( "value" ),
566559
label: option.text(),
567-
accesskey: option.attr( "accesskey" ),
568560
optgroup: optgroup.attr( "label" ) || "",
569561
disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
570562
});
571-
option.removeAttr( "accesskey" );
572563
});
573564
this.items = data;
574565
},
@@ -579,14 +570,6 @@ return $.widget( "ui.selectmenu", {
579570
this.element.show();
580571
this.element.removeUniqueId();
581572
this.label.attr( "for", this.ids.element );
582-
if ( this.accesskey ) {
583-
this.element.attr( "accesskey", this.accesskey );
584-
}
585-
$.each( this.items, function() {
586-
if ( this.accesskey ) {
587-
this.element.attr( "accesskey", this.accesskey );
588-
}
589-
});
590573
}
591574
});
592575

0 commit comments

Comments
 (0)