Change method of hiding extra table layer

This module creates a clone of the existing table
as an extra layer which sits on top of it.

This allows the row headers to sit above the table
content when it scrolls.

We were setting `role=presentation` on the extra
table to hide it from assistive technologies.

It seems that this wasn't working. From the spec'
`role-presentation` should remove the semantics of
the table but leave the content.

Testing in Safari, with the OSX Accessibility
Inspector, this isn't happening and the table is
still being reported as a table by the
accessibility API.

This changes to the `aria-hidden` attribute, to
make sure the extra table is ignored.
This commit is contained in:
Tom Byers
2019-08-16 16:23:29 +01:00
parent 2eed904476
commit 92626c3f41
2 changed files with 2 additions and 2 deletions

View File

@@ -44,7 +44,7 @@
.clone()
.addClass('fullscreen-fixed-table')
.removeClass('fullscreen-scrollable-table')
.attr('role', 'presentation')
.attr('aria-hidden', true)
)
.append(
'<div class="fullscreen-right-shadow" />'

View File

@@ -123,7 +123,7 @@ describe('FullscreenTable', () => {
expect(tableFrame).not.toBeNull();
expect(numberColumnFrame).not.toBeNull();
expect(numberColumnFrame.getAttribute('role')).toEqual('presentation');
expect(numberColumnFrame.getAttribute('aria-hidden')).toEqual('true');
});