Skip to content

Commit

Permalink
interrupt the KeyboardListener on blur, see #1520
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Jul 20, 2023
1 parent 6fe0bd5 commit 728e2d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/listeners/KeyboardListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,14 @@ class KeyboardListener<Keys extends readonly OneKeyStroke[]> implements TInputLi
this.handleCancel();
}

/**
* Interrupts and resets the listener on blur so that state is reset and active keyGroups are cleared.
* Public because this is called with the scenery listener API. Do not call this directly.
*/
public focusout( event: SceneryEvent ): void {
this.interrupt();
}

/**
* Dispose of this listener by disposing of any Callback timers. Then clear all KeyGroups.
*/
Expand Down

0 comments on commit 728e2d6

Please sign in to comment.