Skip to content

Commit

Permalink
Selectmenu: corrections based on code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbeuligmann committed Oct 16, 2012
1 parent 20d19db commit 8e1e956
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ui/jquery.ui.selectmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ $.widget( "ui.selectmenu", {

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

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

// hide original select tag
this.element.hide();
Expand All @@ -89,7 +88,7 @@ $.widget( "ui.selectmenu", {
id: this.ids.button,
width: this.element.outerWidth(),
role: 'combobox',
'aria-labelledby': this.labelElement.attr("id"),
'aria-labelledby': this.labelElement.attr( "id" ),
'aria-expanded': false,
'aria-autocomplete': 'list',
'aria-owns': this.ids.menu,
Expand Down Expand Up @@ -157,7 +156,7 @@ $.widget( "ui.selectmenu", {
that.focus = item.index;

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

},
// set ARIA role
Expand Down Expand Up @@ -384,7 +383,7 @@ $.widget( "ui.selectmenu", {
// change ARIA attr
this.menuItems.find( "a" ).attr( "aria-selected", false );
this._getSelectedItem().find( "a" ).attr( "aria-selected", true );
this.button.attr( "aria-activedescendant", item.element.uniqueId().attr( "id" ) );
this.button.attr( "aria-activedescendant", item.element.attr( "id" ) );
},

_setOption: function( key, value ) {
Expand Down

3 comments on commit 8e1e956

@scottgonzalez
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertbeuligmann Can you please sign our CLA?

@robertbeuligmann
Copy link
Contributor Author

@robertbeuligmann robertbeuligmann commented on 8e1e956 Dec 11, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scottgonzalez
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Robert.

Please sign in to comment.