diff --git a/public/src/css/search.css b/public/src/css/search.css index 4a85f43..b951466 100644 --- a/public/src/css/search.css +++ b/public/src/css/search.css @@ -25,6 +25,7 @@ color: #fff; padding: 1em 1em 0 1em; z-index: 1; + box-sizing: border-box; } #song-search-container.touch-enabled{ diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index c1e0abb..e58c2d2 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -1085,6 +1085,10 @@ class SongSelect{ } this.selectableText = "" + + if(this.search && this.searchContainer){ + this.searchInput() + } }else if(!document.hasFocus() && !p2.session){ if(this.state.focused){ this.state.focused = false @@ -2951,9 +2955,6 @@ class SongSelect{ }) for(var i = 0; i < songs.length; i++){ - if(i >= 50){ - break - } var song = songs[i] var passedFilters = 0 @@ -3029,11 +3030,11 @@ class SongSelect{ } } - return results + return results.slice(0, 50) } - searchInput(e){ - var text = e.target.value.toLowerCase() + searchInput(){ + var text = this.search.input.value.toLowerCase() localStorage.setItem("lastSearchQuery", text) if(text.length === 0){ @@ -3057,7 +3058,8 @@ class SongSelect{ var fontSize = parseFloat(getComputedStyle(this.search.div.querySelector(":scope #song-search")).fontSize.slice(0, -2)) var resultsWidth = parseFloat(getComputedStyle(resultsDiv).width.slice(0, -2)) - var courseWidth = Math.min(3 * fontSize * 1.2, 7 * this.vmin) + var vmin = Math.min(innerWidth, lastHeight) / 100 + var courseWidth = Math.min(3 * fontSize * 1.2, 7 * vmin) var resultWidth = resultsWidth - 1.8 * fontSize - 0.8 * fontSize - (courseWidth + 0.4 * fontSize * 1.2) * 5 - 0.6 * fontSize this.ctx.save()