Skip to content

Commit

Permalink
ba292272441e8cb0f155d421688711a7cf7280f2 Fix: aria-label for sortin…
Browse files Browse the repository at this point in the history
…g should be on the element with `role=button`

https://datatables.net/forums/discussion/80509

165ea7f3bfce315ed8a9487286a15b604c0a6eac Examples: Add lang="en" to html tag

Sync to source repo @165ea7f3bfce315ed8a9487286a15b604c0a6eac
  • Loading branch information
dtbuild committed Jan 28, 2025
1 parent 74bd818 commit f344bd5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion datatables.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
],
"src-repo": "http://github.com/DataTables/DataTablesSrc",
"last-tag": "2.2.1",
"last-sync": "9f7bbc77a204392ce37883057264b4be2ebbfcb4"
"last-sync": "165ea7f3bfce315ed8a9487286a15b604c0a6eac"
}
12 changes: 6 additions & 6 deletions js/dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -13050,16 +13050,16 @@
cell.removeAttr('aria-sort');
}

cell.attr('aria-label', orderable
? col.ariaTitle + ctx.api.i18n('oAria.orderable' + ariaType)
: col.ariaTitle
);

// Make the headers tab-able for keyboard navigation
if (orderable) {
var orderSpan = cell.find('.dt-column-order');

orderSpan.attr('role', 'button');
orderSpan
.attr('role', 'button')
.attr('aria-label', orderable
? col.ariaTitle + ctx.api.i18n('oAria.orderable' + ariaType)
: col.ariaTitle
);

if (tabIndex !== -1) {
orderSpan.attr('tabindex', tabIndex);
Expand Down
2 changes: 1 addition & 1 deletion js/dataTables.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dataTables.min.mjs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions js/dataTables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13015,16 +13015,16 @@ $.extend( true, DataTable.ext.renderer, {
cell.removeAttr('aria-sort');
}

cell.attr('aria-label', orderable
? col.ariaTitle + ctx.api.i18n('oAria.orderable' + ariaType)
: col.ariaTitle
);

// Make the headers tab-able for keyboard navigation
if (orderable) {
var orderSpan = cell.find('.dt-column-order');

orderSpan.attr('role', 'button');
orderSpan
.attr('role', 'button')
.attr('aria-label', orderable
? col.ariaTitle + ctx.api.i18n('oAria.orderable' + ariaType)
: col.ariaTitle
);

if (tabIndex !== -1) {
orderSpan.attr('tabindex', tabIndex);
Expand Down

0 comments on commit f344bd5

Please sign in to comment.