Skip to content

Commit

Permalink
'invisible' is a supported value for interactiveHighlight, see #1372
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Mar 13, 2022
1 parent 8853900 commit 1b92317
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions js/accessibility/voicing/InteractiveHighlighting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const INTERACTIVE_HIGHLIGHTING_OPTIONS = [
];

type InteractiveHighlightingSelfOptions = {
interactiveHighlight?: Node | Shape | null,
interactiveHighlight?: Node | Shape | null | 'invisible',
interactiveHighlightLayerable?: boolean
};

Expand Down Expand Up @@ -59,7 +59,7 @@ const InteractiveHighlighting = <SuperType extends Constructor>( Type: SuperType

// The highlight that will surround this Node when it is activated and a Pointer is currently over it. When
// null, the focus highlight will be used (as defined in ParallelDOM.js).
_interactiveHighlight: Shape | Node | null;
_interactiveHighlight: Shape | Node | null | 'invisible';

// If true, the highlight will be layerable in the scene graph instead of drawn
// above everything in the HighlightOverlay. If true, you are responsible for adding the interactiveHighlight
Expand Down Expand Up @@ -134,7 +134,7 @@ const InteractiveHighlighting = <SuperType extends Constructor>( Type: SuperType
* Set the interactive highlight for this node. By default, the highlight will be a pink rectangle that surrounds
* the node's local bounds.
*/
setInteractiveHighlight( interactiveHighlight: Node | Shape | null ) {
setInteractiveHighlight( interactiveHighlight: Node | Shape | null | 'invisible' ) {

if ( this._interactiveHighlight !== interactiveHighlight ) {
this._interactiveHighlight = interactiveHighlight;
Expand All @@ -152,16 +152,16 @@ const InteractiveHighlighting = <SuperType extends Constructor>( Type: SuperType
}
}

set interactiveHighlight( interactiveHighlight: Node | Shape | null ) { this.setInteractiveHighlight( interactiveHighlight ); }
set interactiveHighlight( interactiveHighlight: Node | Shape | null | 'invisible' ) { this.setInteractiveHighlight( interactiveHighlight ); }

/**
* Returns the interactive highlight for this Node.
*/
getInteractiveHighlight(): Node | Shape | null {
getInteractiveHighlight(): Node | Shape | null | 'invisible' {
return this._interactiveHighlight;
}

get interactiveHighlight(): Node | Shape | null { return this.getInteractiveHighlight(); }
get interactiveHighlight(): Node | Shape | null | 'invisible' { return this.getInteractiveHighlight(); }

/**
* Sets whether the highlight is layerable in the scene graph instead of above everything in the
Expand Down
2 changes: 1 addition & 1 deletion js/overlays/HighlightOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class HighlightOverlay {
*
* @param {Trail} trail - The focused trail to highlight. It assumes that this trail is in this display.
* @param {Node} node - Node receiving the highlight
* @param {Node|Shape|null} nodeHighlight - the highlight to use
* @param {Node|Shape|null|'invisible'} nodeHighlight - the highlight to use
* @param {boolean} layerable - Is the highlight layerable in the scene graph?
* @param {BooleanProperty} visibleProperty - Property controlling the visibility for the provided highlight
*/
Expand Down

0 comments on commit 1b92317

Please sign in to comment.