This commit is contained in:
@ -23,7 +23,10 @@ function filterSongs() {
|
||||
const searchTerm = sanitizeString(search.value);
|
||||
const songs = Array.from(songList.children);
|
||||
songs.forEach(song => {
|
||||
const matching = song.dataset.title.includes(searchTerm) && (!selectedCategory || song.dataset.category === selectedCategory);
|
||||
const matching = (
|
||||
(song.dataset.title.includes(searchTerm) || (song.dataset.artist && song.dataset.artist.includes(searchTerm))) &&
|
||||
(!selectedCategory || song.dataset.category === selectedCategory)
|
||||
);
|
||||
song.classList.toggle("hidden", !matching);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user