From 17bec4472054a9953bea5d2565716957162042fb Mon Sep 17 00:00:00 2001 From: Bui Date: Fri, 25 Feb 2022 19:42:57 +0000 Subject: [PATCH] check for event --- public/src/js/songselect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index 7911685..f874317 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -411,7 +411,7 @@ class SongSelect{ }else if (this.search){ if(name === "back" || (event && event.keyCode && event.keyCode === 70 && ctrl)) { this.removeSearch(true) - event.preventDefault() + if(event){ event.preventDefault() } }else if(name === "down" && this.search.results.length){ if(this.search.input == document.activeElement && this.search.results){ this.searchSetActive(0) @@ -442,7 +442,7 @@ class SongSelect{ }else if(this.state.screen === "song"){ if(event && event.keyCode && event.keyCode === 70 && ctrl){ this.displaySearch() - event.preventDefault() + if(event){ event.preventDefault() } }else if(name === "confirm"){ this.toSelectDifficulty() }else if(name === "back"){