check for event

This commit is contained in:
Bui 2022-02-25 19:42:57 +00:00
parent 5145aeccec
commit 17bec44720

View File

@ -411,7 +411,7 @@ class SongSelect{
}else if (this.search){ }else if (this.search){
if(name === "back" || (event && event.keyCode && event.keyCode === 70 && ctrl)) { if(name === "back" || (event && event.keyCode && event.keyCode === 70 && ctrl)) {
this.removeSearch(true) this.removeSearch(true)
event.preventDefault() if(event){ event.preventDefault() }
}else if(name === "down" && this.search.results.length){ }else if(name === "down" && this.search.results.length){
if(this.search.input == document.activeElement && this.search.results){ if(this.search.input == document.activeElement && this.search.results){
this.searchSetActive(0) this.searchSetActive(0)
@ -442,7 +442,7 @@ class SongSelect{
}else if(this.state.screen === "song"){ }else if(this.state.screen === "song"){
if(event && event.keyCode && event.keyCode === 70 && ctrl){ if(event && event.keyCode && event.keyCode === 70 && ctrl){
this.displaySearch() this.displaySearch()
event.preventDefault() if(event){ event.preventDefault() }
}else if(name === "confirm"){ }else if(name === "confirm"){
this.toSelectDifficulty() this.toSelectDifficulty()
}else if(name === "back"){ }else if(name === "back"){