Skip to content

Commit

Permalink
assert item.node has no accessibleContent, fit focus highlight to item,
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Jan 22, 2019
1 parent 10e2a2e commit 8b95298
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions js/ComboBoxItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ define( require => {
constructor( node, value, options ) {

assert && assert( node instanceof Node, 'invalid node: ' + node );
assert && assert( !node.accessibleContent, 'accessibleContent is set by ComboBox, use options.a11yLabel' );

options = _.extend( {

Expand Down
6 changes: 2 additions & 4 deletions js/ComboBoxListItemNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ define( require => {

assert && assert( item instanceof ComboBoxItem );

// TODO sun#314 assert you may not be allowed to have accessibleContent on the item.node, since we set the innerContent on this LI

options = _.extend( {

cursor: 'pointer',
Expand Down Expand Up @@ -82,8 +80,8 @@ define( require => {
this.highlightRectangle = highlightRectangle;
this.highlightFill = options.highlightFill;

// the focus highlight wraps around the entire item rectangle
itemNodeWrapper.focusHighlight = Shape.bounds( itemNodeWrapper.parentToLocalBounds( this.localBounds ) );
// focus highlight is fitted to this Node's bounds, so that it doesn't overlap items above/below in the list box
this.focusHighlight = Shape.bounds( this.localBounds );
}

/**
Expand Down

0 comments on commit 8b95298

Please sign in to comment.