[Accessibility] Editor Tabs and Source Tabs should be accessible
There are several improvements that can be done for the source tabs to make them awesome for accessibility:
- [ ] Most Importantly both tab widgets (source and editor tabs) should be the same shared component component that would be styled/configured differently for a particular location.
- [ ] Reachable by keyboard: tabs should be accessible with the keyboard, right now there's not way to focus on the tab (if there is, it is not visible)
- [ ] Tabs should be navigatable via keyboard -- there's a blueprint for adding this functionality here; https://github.com/devtools-html/debugger.html/pull/5806
- [ ] Styling for keyboard focus for tabs
- [ ] Close tab and add new (+) should be real buttons (or with role button), alternative text and be keyboard accessible: tabbable, activatable and have focus styling
- [x] source-tabs should semantically be tabs. Marco has a good article about this.
Editor Tabs

Source Tabs
Questions
tabs should be accessible with the keyboard
@garbee looked at our tabs before and found them difficult to make accessible given the HTML structure. Does it make sense to try and refactor the HTML or do some JS controls around where tab sound take you?
Styling for keyboard focus for tabs
Is there a good default for tab focus state? I wish editor tabs were focusable :P
Styling would be handled the same as buttons in most cases. As that is essentially what tabs are at the end of it all.
The specific problem in carrying this out with tabs though, is the close trigger. Those should be nested within the tab node, and buttons can't be nested in buttons. That's not nice. One solution to this though is borrowing from the linked tutorial. Have the list items, with anchors for the triggers and the close buttons as a button beside the anchor in the markup. This would allow for the anchor to be properly accessible and stylable, while allowing a button node to handle the close trigger which is what makes the most sense there. Win-Win on both sides. All the triggers are fully accessible and easily stylable.
<ul> <!-- Because tabs are lists -->
<li>
<a href>app-view.js</a><button>close</button>
<li>
<a href>app.js</a><button>close</button>
</ul>
should be keyboard navigable
- left and right arrow should change the focused tab
- space or enter should select a source
- tab/shift tab should jump to the command bar or source tree
We'll listen for arrows and space bar events and set the ariaActiveDescendent state
--- a/src/components/Editor/Tabs.js
+++ b/src/components/Editor/Tabs.js
@@ -325,6 +325,17 @@ class SourceTabs extends PureComponent {
);
}
+ onKeyDown() {
+ if (arrow) {
+ return this.setState({ariaActiveDescendent: tabIndes})
+ }
+
+ if (spaceBar) {
+ const source = getSource(tabIndex)
+ this.props.selectSource(source);
+ }
+ }
Style the tabs
We'll style the tabs w/ ariaActiveDescendent. This strategy will let us higlight the "active" tab when the tab list is in focus.
renderTabs() {
const { sourceTabs } = this.props;
if (!sourceTabs) {
@@ -332,7 +343,12 @@ class SourceTabs extends PureComponent {
}
return (
- <div className="source-tabs" ref="sourceTabs">
+ <div
+ className="source-tabs"
+ ref="sourceTabs"
+ tabIndex="0"
// wee'll need to figure out how to do this correctly.
+ {/* ariaActiveDescendent="tab-1" */}
+ >
{sourceTabs.map(this.renderSourceTab)}
</div>
);
@@ -404,6 +420,7 @@ class SourceTabs extends PureComponent {
<div
className={className}
key={source.get("id")}
// each tab now needs an id
+ id={`tab-1`}
/claim
Our team will work on this as part of an assignment for CSC426. @carterehc @acheamponge @chauwaj
Thanks for claiming the issue! :wave:
Here are some link for getting setup, contributing, and development tips. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
Add new button has been removed in another update, so there's not a need to look for that. We weren't able to convert the tabs into lists in order to get keyboard navigation to work properly. Also, this issue seems similar to issue #4070 where the close button is also needing keyboard navigation.
/unclaim
/unclaim
@yzen @darkwing what would you like to do here?
We'll need to do a larger review and make some decisions. Making the close button an actual button seems reasonably easy. We'll need to think about keyboard shortcuts and tabbing, however. I'm thinking CTRL+0, CTRO+1, etc. would work for selecting individual tabs. How we navigate from one to the next....that will take some thought.
I drafted keyboard navigation in this pull request: https://github.com/devtools-html/debugger.html/pull/5806
I'd love for someone to drag it across the finish line!
/claim
I'd love to work on that, but it might take a while as I'm on a tight schedule. If someone is willing to work on that as well and can finish it faster let me know.
Thanks for claiming the issue! :wave:
!!! Please check your email and confirm the invitation
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
/claim
Would love to work on it. Might take some time to set it up and understand the current code. But will try to finish as soon as I can.
Thanks for claiming the issue! :wave:
!!! Please check your email and confirm the invitation
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
/claim
Figured I'll take a shot at this, as I have experience implementing tabs per the WAI-ARIA authoring practices 1.1 for a React accessible component library.
Worst case I'll unclaim if it ends up being more than I can handle, and will at least report back with any findings.
Thanks for claiming the issue! :wave:
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
Hey @ahuth what are your thoughts on the editor tabs? feasible? We can also redo the UX to make it easier for accessibility
The current UX is definitely feasible. The hard part I think will be that the implementation needs to be changed pretty significantly for them.
got it
On Fri, Aug 3, 2018 at 5:41 PM Andrew [email protected] wrote:
The current UX is definitely feasible. The hard part I think will be that the implementation needs to be changed pretty significantly for them.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/devtools-html/debugger.html/issues/4075#issuecomment-410383641, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPiYuj5hO4EA_72bA5XWvqCpvZFbZPRks5uNMOTgaJpZM4PbPbx .