mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-27 00:54:15 +01:00
Accessibility: Add live region attribute to table info, remove from table
- Based on feedback from Rich Caloggero in forum thread 13421 the ARIA live region DataTables was adding to the TBODY element of the table have been moved to the table information element, so screen readers don't go mad announcing the new informaiton in the table on every change, but rather just read the summary.
This commit is contained in:
parent
5ca931c23b
commit
74a78b2010
@ -1 +1 @@
|
||||
bef23129b8047b26e86b2aa75ed213132bd691c0
|
||||
490f897e3bdc5c679f8a3ecf2522886d293f5c0f
|
||||
|
19
media/js/jquery.dataTables.js
vendored
19
media/js/jquery.dataTables.js
vendored
@ -2515,7 +2515,11 @@
|
||||
{
|
||||
var
|
||||
tid = settings.sTableId,
|
||||
nodes = settings.aanFeatures.i;
|
||||
nodes = settings.aanFeatures.i,
|
||||
n = $('<div/>', {
|
||||
'class': settings.oClasses.sInfo,
|
||||
'id': ! nodes ? tid+'_info' : null
|
||||
} );
|
||||
|
||||
if ( ! nodes ) {
|
||||
// Update display on each draw
|
||||
@ -2524,14 +2528,16 @@
|
||||
"sName": "information"
|
||||
} );
|
||||
|
||||
n
|
||||
.attr( 'role', 'alert' )
|
||||
.attr( 'aria-live', 'polite' )
|
||||
.attr( 'aria-relevant', 'all' );
|
||||
|
||||
// Table is described by our info div
|
||||
$(settings.nTable).attr( 'aria-describedby', tid+'_info' );
|
||||
}
|
||||
|
||||
return $('<div/>', {
|
||||
'class': settings.oClasses.sInfo,
|
||||
'id': ! nodes ? tid+'_info' : null
|
||||
} )[0];
|
||||
return n[0];
|
||||
}
|
||||
|
||||
|
||||
@ -5878,9 +5884,6 @@
|
||||
this.appendChild( tbody[0] );
|
||||
}
|
||||
oSettings.nTBody = tbody[0];
|
||||
oSettings.nTBody.setAttribute( "role", "alert" );
|
||||
oSettings.nTBody.setAttribute( "aria-live", "polite" );
|
||||
oSettings.nTBody.setAttribute( "aria-relevant", "all" );
|
||||
|
||||
var tfoot = $(this).children('tfoot');
|
||||
if ( tfoot.length === 0 && captions.length > 0 && (oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "") )
|
||||
|
Loading…
x
Reference in New Issue
Block a user