Merge pull request #3645 from alphagov/fix-focus-on-table

Make only the scrollable table focusable
This commit is contained in:
Tom Byers
2020-09-23 11:32:04 +01:00
committed by GitHub
2 changed files with 18 additions and 1 deletions

View File

@@ -37,6 +37,7 @@
this.insertShims = () => {
const attributesForFocus = 'role aria-labelledby tabindex';
let captionId = this.$table.find('caption').text().toLowerCase().replace(/[^A-Za-z]+/g, '');
this.$table.find('caption').attr('id', captionId);
@@ -48,6 +49,7 @@
.clone()
.addClass('fullscreen-fixed-table')
.removeClass('fullscreen-scrollable-table')
.removeAttr(attributesForFocus)
.attr('aria-hidden', true)
)
.append(