Skip to content

Commit

Permalink
set focusable:true in ComboBoxListItemNode options, #445
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Jan 20, 2019
1 parent 03b8421 commit e07398c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
11 changes: 0 additions & 11 deletions js/ComboBoxListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,8 @@ define( require => {
// a11y - keep this PDOM attribute in sync
this.updateActiveDescendant( nextListItemNode );

// clear focus for previous item
this.focusedItemNode.focusable = false;

// set focus for next item
this.focusedItemNode = nextListItemNode;
this.focusedItemNode.focusable = true; //TODO sun#314 why do we need to set focusable=true?
this.focusedItemNode.focus();
break;
}
Expand Down Expand Up @@ -236,17 +232,10 @@ define( require => {
const listItemNode = this.listItemNodes[ i ];
if ( this.property.value === listItemNode.item.value ) {
this.focusedItemNode = listItemNode;
this.focusedItemNode.focusable = true;
this.focusedItemNode.focus();
}
}
}
else if ( this.focusedItemNode ) {

// listbox is invisible, clear focus
this.focusedItemNode.focusable = false;
this.focusedItemNode = null;
}
}

// TODO: sun#314 we don't likely need this anymore
Expand Down
1 change: 1 addition & 0 deletions js/ComboBoxListItemNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ define( require => {

// a11y
tagName: 'li',
focusable: true,
ariaRole: 'option',
a11yLabel: null

Expand Down

0 comments on commit e07398c

Please sign in to comment.