Skip to content

Commit

Permalink
interrupt KeyboardDragListener on blur, see #1285
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Sep 20, 2021
1 parent c24f936 commit d73d6fc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions js/listeners/KeyboardDragListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,16 @@ class KeyboardDragListener {
this.resetPressAndHold();
}

/**
* Interrupts and resets the listener on blur so that listener state is reset and keys are removed from the keyState
* array. Public because this is called with the scenery listener API.
* @public
*
* @param {SceneryEvent} event
*/
blur( event ) {
this.interrupt();
}

/**
* Step function for the drag handler. JavaScript does not natively handle multiple keydown events at once,
Expand Down

0 comments on commit d73d6fc

Please sign in to comment.