Skip to content
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
18 changes: 18 additions & 0 deletions R/ro_dt_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ ro_dt_table <- function(data, caption, sorting = FALSE, pagelength = 10) {
),
callback = JS(
"
// Inject screen-reader-only style once (not dependent on host Bootstrap version)
if (!document.getElementById('ro-dt-table-visually-hidden-style')) {
var style = document.createElement('style');
style.id = 'ro-dt-table-visually-hidden-style';
style.innerHTML = '.visually-hidden {' +
'position: absolute !important;' +
'width: 1px !important;' +
'height: 1px !important;' +
'padding: 0 !important;' +
'margin: -1px !important;' +
'overflow: hidden !important;' +
'clip: rect(0, 0, 0, 0) !important;' +
'white-space: nowrap !important;' +
'border: 0 !important;' +
'}';
document.head.appendChild(style);
}

// Add ARIA role and label to pagination
function addPaginationARIA() {
var $container = $(table.table().container());
Expand Down
12 changes: 0 additions & 12 deletions R/ro_dt_theme.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,6 @@ ro_dt_theme <- function(
box-shadow: none !important;
}

/* Screen-reader-only text (not dependent on host Bootstrap version) */
.visually-hidden {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
margin: -1px !important;
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
white-space: nowrap !important;
border: 0 !important;
}
",
base_family,
base_family,
Expand Down
Loading