Skip to content

Commit

Permalink
www/index.html
Browse files Browse the repository at this point in the history
www/js/logic.js
- Implemented a fix to reset the "display" property of hidden rows after the input clear
  • Loading branch information
edgarchinchilla committed Aug 7, 2024
1 parent 6b216bb commit 875929f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<!-- FILTER FIELD-->
<form id="searchBox">
<input type="text" id="filter" placeholder="Filter by App name...">
<button type="reset" id="clear">x</button>
<button type="reset" id="clear" onClick="resetTableFilters()">x</button>
</form>

<!-- DYNAMIC APPS LIST HOLDER -->
Expand Down
11 changes: 11 additions & 0 deletions www/js/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,15 @@ function addTableFiltering() {
row.style.display = shouldShowRow ? '' : 'none';
}
});
}

// RESET TABLE FILTERS
function resetTableFilters() {
const tableElement = document.getElementById('appsList');
const tableRows = tableElement.querySelectorAll('tbody tr');

for (let i = 0; i < tableRows.length; i++) {
const row = tableRows[i];
row.style.display = '';
}
}

0 comments on commit 875929f

Please sign in to comment.