Skip to content

Lexicon 1594 - table selection and deletion controls dont indicate which row #1612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions fonts/_config.fonts.scss

This file was deleted.

15 changes: 15 additions & 0 deletions js/PulsarUIComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,21 @@ PulsarUIComponent.getDatatableOptions = function ($table) {
style: 'multi'
};

// Update aria-labels with correct row numbers
$table.on('draw.dt', function() {
const api = $table.DataTable();
const pageInfo = api.page.info();
const start = pageInfo.start;

$table.find('tbody tr').each(function(index) {
const rowNumber = start + index + 1;
const $row = $(this);

// Update checkbox aria-label
$row.find('.js-select').attr('aria-label', `Select row ${rowNumber}`);
});
});

return options;
};

Expand Down
18 changes: 15 additions & 3 deletions views/lexicon/tables/sortable.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@
'tabindex': '0'
})
}}
{{ html.remove_button({ 'placement': 'right' }) }}
{{ html.remove_button({
'placement': 'right',
'label': 'Remove row 1'
})
}}
</td>
</tr>

Expand Down Expand Up @@ -83,7 +87,11 @@
'tabindex': '0'
})
}}
{{ html.remove_button({ 'placement': 'right' }) }}
{{ html.remove_button({
'placement': 'right',
'label': 'Remove row 2'
})
}}
</td>
</tr>

Expand Down Expand Up @@ -119,7 +127,11 @@
'tabindex': '0'
})
}}
{{ html.remove_button({ 'placement': 'right' }) }}
{{ html.remove_button({
'placement': 'right',
'label': 'Remove row 3'
})
}}
</td>
</tr>
</tbody>
Expand Down
Loading