This repository was archived by the owner on May 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -385,7 +385,8 @@ class SpatialNavigation {
385385 }
386386
387387 bindEventHandlers ( ) {
388- if ( window ) {
388+ // We check both because the React Native remote debugger implements window, but not window.addEventListener.
389+ if ( window && window . addEventListener ) {
389390 this . keyDownEventListener = ( event ) => {
390391 if ( this . paused === true ) {
391392 return ;
@@ -449,7 +450,8 @@ class SpatialNavigation {
449450 }
450451
451452 unbindEventHandlers ( ) {
452- if ( window ) {
453+ // We check both because the React Native remote debugger implements window, but not window.removeEventListener.
454+ if ( window && window . removeEventListener ) {
453455 window . removeEventListener ( 'keydown' , this . keyDownEventListener ) ;
454456 this . keyDownEventListener = null ;
455457
You can’t perform that action at this time.
0 commit comments