Skip to content

Commit 8e1e956

Browse files
Selectmenu: corrections based on code review.
1 parent 20d19db commit 8e1e956

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ui/jquery.ui.selectmenu.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ $.widget( "ui.selectmenu", {
7373

7474
_drawButton: function() {
7575
var tabindex = this.element.attr( 'tabindex' );
76-
var labelSelector = "label[for='" + this.element.attr("id") + "']";
7776

7877
// Find existing label
79-
this.labelElement = $( labelSelector ).uniqueId();
78+
this.labelElement = $( "label[for='" + this.element.attr("id") + "']" ).uniqueId();
8079

8180
// hide original select tag
8281
this.element.hide();
@@ -89,7 +88,7 @@ $.widget( "ui.selectmenu", {
8988
id: this.ids.button,
9089
width: this.element.outerWidth(),
9190
role: 'combobox',
92-
'aria-labelledby': this.labelElement.attr("id"),
91+
'aria-labelledby': this.labelElement.attr( "id" ),
9392
'aria-expanded': false,
9493
'aria-autocomplete': 'list',
9594
'aria-owns': this.ids.menu,
@@ -157,7 +156,7 @@ $.widget( "ui.selectmenu", {
157156
that.focus = item.index;
158157

159158
// Set ARIA active decendent
160-
that.button.attr( "aria-activedescendant", item.element.uniqueId().attr( "id" ) );
159+
that.button.attr( "aria-activedescendant", item.element.attr( "id" ) );
161160

162161
},
163162
// set ARIA role
@@ -384,7 +383,7 @@ $.widget( "ui.selectmenu", {
384383
// change ARIA attr
385384
this.menuItems.find( "a" ).attr( "aria-selected", false );
386385
this._getSelectedItem().find( "a" ).attr( "aria-selected", true );
387-
this.button.attr( "aria-activedescendant", item.element.uniqueId().attr( "id" ) );
386+
this.button.attr( "aria-activedescendant", item.element.attr( "id" ) );
388387
},
389388

390389
_setOption: function( key, value ) {

0 commit comments

Comments
 (0)