Skip to content

Commit

Permalink
prevent default on WASD keys when using KeyboardDragListener, phetsim…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jan 26, 2019
1 parent 54b7664 commit f5c8e07
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/accessibility/listeners/KeyboardDragListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,9 @@ define( function( require ) {
keydown: function( event ) {
var domEvent = event.domEvent;

// required to work with Safari and VoiceOver, otherwise arrow keys will move virtual cursor
if ( KeyboardUtil.isArrowKey( domEvent.keyCode ) ) {
// required to work with Safari and VoiceOver, otherwise arrow keys will move virtual cursor, see https://github.com/phetsims/balloons-and-static-electricity/issues/205#issuecomment-263428003
// prevent default for WASD too, see https://github.com/phetsims/friction/issues/167
if ( KeyboardUtil.isArrowKey( domEvent.keyCode ) || KeyboardUtil.isWASDKey( domEvent.keyCode ) ) {
domEvent.preventDefault();
}

Expand Down

0 comments on commit f5c8e07

Please sign in to comment.