Don't search if input is empty

This commit is contained in:
Wiwi Kuan
2023-12-27 11:25:19 +08:00
committed by GitHub
parent ed5e9c88c2
commit 39e7a8f568

View File

@@ -83,7 +83,7 @@
var input = removeAccents(document.getElementById('searchInput').value.toLowerCase());
// 空的話就不搜尋了
if (input === '') {
if (input.trim() === '') {
document.getElementById('results').innerHTML = '喜歡這個工具的話,請多到 <a href="https://nicechord.com" target="_blank">NiceChord.com</a> 逛逛喔!';
return;
}