Skip to content

Commit

Permalink
update cue visibility from inputEnabled, #720
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Mar 4, 2022
1 parent 6888da0 commit 0d4f4dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/accessibility/GrabDragInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class GrabDragInteraction extends EnabledComponent {
// controls whether or not to show the "Grab" cue node that is displayed on focus - by
// default it will be shown on focus until it has been successfully grabbed with a keyboard
showGrabCueNode: () => {
return this.numberOfKeyboardGrabs < 1;
return this.numberOfKeyboardGrabs < 1 && node.inputEnabled;
},

// whether or not to display the Node for the "Drag" cue node once the grabbable Node has been picked up,
Expand Down Expand Up @@ -553,10 +553,16 @@ class GrabDragInteraction extends EnabledComponent {
this.node.focusable = enabled;
} );

const boundUpdateVisibilityForCues = this.updateVisibilityForCues.bind( this );

this.node.inputEnabledProperty.lazyLink( boundUpdateVisibilityForCues );

// @private
this.disposeGrabDragInteraction = () => {

this.node.removeInputListener( this.pressListener );
this.node.inputEnabledProperty.unlink( boundUpdateVisibilityForCues );

keyboardDragListener.dragEmitter.removeListener( dragListener );

// Remove listeners according to what state we are in
Expand Down

0 comments on commit 0d4f4dd

Please sign in to comment.