Skip to content

Commit daa4770

Browse files
committed
Fix: Considering the scenario when download does not have a data-tags attribute
1 parent 59ce4cd commit daa4770

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

assets/javascript/downloads.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ function filterResults() {
353353
// exact tag match re-order
354354
if (downloadsSearch.searchTerm !== null && downloadsSearch.searchTerm !== undefined) {
355355
let searched = downloadsSearch.searchTerm.toLowerCase();
356-
let tags = download.getAttribute("data-tags").split(",");
356+
let tags = download.dataset.tags?.split(",") || [];
357357
if (searched !== "" && tags.indexOf(searched) >= 0) {
358358
let parent = download.parentElement;
359359
parent.removeChild(download);

0 commit comments

Comments
 (0)