Skip to content

Commit

Permalink
table sort on icon only
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-kennedy-ecs committed Dec 23, 2024
1 parent db9d4de commit 1b813ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/registrar/assets/src/js/getgov/table-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,10 @@ export class BaseTable {
// Add event listeners to table headers for sorting
initializeTableHeaders() {
this.tableHeaders.forEach(header => {
header.addEventListener('click', () => {
const sortBy = header.getAttribute('data-sortable');
const sortBy = header.getAttribute('data-sortable');
// add event listener to respond to clicks on the button
let button = header.querySelector('.usa-table__header__button')
button.addEventListener('click', () => {
let order = 'asc';
// sort order will be ascending, unless the currently sorted column is ascending, and the user
// is selecting the same column to sort in descending order
Expand Down

0 comments on commit 1b813ca

Please sign in to comment.