box-ui-elements icon indicating copy to clipboard operation
box-ui-elements copied to clipboard

fix(ContentPreview): A11Y - remove index zero to avoid tab stops

Open fsuarez-globant opened this issue 4 years ago • 2 comments

fix(ContentPreview): A11Y - remove index zero to avoid tab stops

The file preview itself is contained in one <div> elements with tabindex="0". This <div> in the keyboard navigation flow, creating invisible Tab stops with no functionality. This are likely to create confusion for screen reader and keyboard users. For this reason I removed tabindex=0 in the ContentPreview component.

Before change Screen Shot 2021-06-18 at 3 57 07 PM After change Screen Shot 2021-06-18 at 3 58 52 PM

fsuarez-globant avatar Jun 18 '21 21:06 fsuarez-globant

@jstoffan I checked that the functionality of moving files will work when users presses the right and left arrow. This feature works because inside the div where the tabIndex was removed, there are another two tabindexes ( document and thumbnails side bar) and it can trigger the onKeydown events.

fsuarez-globant avatar Jul 06 '21 14:07 fsuarez-globant

@fsuarez-globant, thanks for checking. However, since this attribute was added quite a while ago via 1a0ff4cc72ddfe7031b8ab43c88cdcf04a4b2bcb, I'm concerned we're missing something and risk causing a regression. Does the autofocus feature still work properly? Does left/right work with all file types (images, videos, audio, text, etc.)?

jstoffan avatar Jul 06 '21 17:07 jstoffan