Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs: A11y] Add accessibility docs #9519

Merged
merged 4 commits into from
Jun 26, 2017
Merged

Conversation

AlmeroSteyn
Copy link
Contributor

I want to make a proposal to add Accessibility documentation to the React docs.

Being a great fan of both accessibility and React, I have experienced how well React can be geared to easily adding accessibility features. Adding docs about it would maybe help with more accessible React apps being built out there.

As base for the proposal I have created a taste of the docs it would become. However, I would first like to test if this kind and style of accessibility docs would fit the vision of the maintainers before spending too much time on it.

Here is a snippet from a section of what I have already made:
image

I have gone for the Eutopia, with a section in the main menu being dedicated to accessibility. It is very hard to bring the necessary basics home in a one pager, I think. I know it is a big ask to add a major section to the docs but maybe it would be great to show off a11y as a first class concern in the docs.

So the sections I have in mind are:

Building accessible forms
Here I have already created a section on labelling but it needs to be extended with validation error texts.

Controlling focus
Showing how showing focus on form controls should be maintained and how one can ensure that keyboard users do not get frustrated by losing focus and how to bypass blocks of content in pages.

ARIA roles, states and properties
An overview of what ARIA is and how can be used to create more complex accessible widgets

Developer tools
A look at tooling that makes accessibility visible for developers. Examples would be browser a11y inspectors, eslint-plugin-jsx-a11y, react-axe, aXe itself and a quick how to on screen readers.

Looking forward to hearing your comments :-)

@sophiebits
Copy link
Collaborator

Thank you! I definitely want to get some a11y docs in – this has been on my todo list for a while. I don't think we should attempt to do a full tutorial on how to make accessible web apps since it is almost unchanged in React from any other web app and I'm sure there are great tutorials out there already.

How about we link to some external guides about accessible web apps generally (that discuss labels, ARIA, labels, tab order, screen reader–only content, etc)? Maybe you can find some high quality ones that are good. And we can consolidate into a single new page – probably not a whole section – explaining how those interact with React and discuss React DOM's support of aria-*, event handlers, tabIndex/htmlFor, and whatever else might be relevant. We can include a brief bit on designing accessible components (for example, it might be wise to have a required "label" prop and then having another prop to indicate whether that label is visible or hidden so that component users don't forget to add an accessibility label). I don't have a complete list in mind right now but hopefully that gives the right idea of what I'm imagining. What do you think?

@AlmeroSteyn
Copy link
Contributor Author

@spicyj Hey, thanks for the reply! Constantly finding such a general openness towards a11y in the React community and that is awesome, thank you!

Sounds like a great idea indeed. Perhaps better not to reinvent the wheel here.

For instance labelling: https://www.w3.org/WAI/tutorials/forms/labels/

Already have a pile of trusted resources I can sift through and see.

Happy to run with this. Give me a few days or so to get my ducks in a row and will get back to further the discussion.

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tagging as requested changes

@sophiebits
Copy link
Collaborator

cc @jessebeach @tatermelon for awareness :)

@jessebeach
Copy link
Contributor

Hello @AlmeroSteyn ! Great to see you in this repo as well!

How about we link to some external guides about accessible web apps generally (that discuss labels, ARIA, labels, tab order, screen reader–only content, etc)?

Agreed. @tatermelon and @mcking65 are working on canonical examples for components in the https://github.com/w3c/aria-practices repository. I'd love to see us centralize our efforts to provide functional examples there.

A look at tooling that makes accessibility visible for developers. Examples would be browser a11y inspectors, eslint-plugin-jsx-a11y, react-axe, aXe itself and a quick how to on screen readers.

Great, links to additional resources are very helpful. I'm sure @marcysutton @WilcoFiers and @dylanb would be glad for the mention of aXe.

@dylanb
Copy link

dylanb commented Apr 26, 2017

@AlmeroSteyn That outline looks great - I know this is nit-picking a bit (and also slightly off-topic) - but we don't recommend wrapped labels as the preferred method simply because it reduces the touch target size for putting focus into the input field. When you use for-id, then clicking the label text will place focus in the input - which is of course helpful for things that are small like radios or checkboxes.

@AlmeroSteyn
Copy link
Contributor Author

@jessebeach Likewise! Linking to external resources does indeed make more sense.

I have a question, and I've had it for a while now.

How would you bridge the "gap" between those examples there and using them in React components, especially for new devs? I often go to the ARIA pages to find examples and ideas but I can help myself in JavaScript, I love a11y and I know how components work, so the translation is relatively easy and I have a reason to take the time to do it. But the best accessible examples you can find are almost always imperative code.

So I have been wondering how one can make it easier for the React dev, in this case, and how to make them aware. The number of devs I come across that even know these techniques and examples exist is far too low.

I guess that is why my first instincts here were to rehash a bit of already published material but with "copy-and-pastable" accessible React code. If it already exists I have been unable to find it.

An a11y doc here linking to these resources would certainly address the awareness aspect but I keep wondering if we don't need similar examples for React as well. However, I realise it is quite an undertaking and day job time constraints have prevented me from going solo down this path...

What do you think?

@AlmeroSteyn
Copy link
Contributor Author

@dylanb Thank you for the info. Love learning more a11y caveats, so please nitpick away!

Could you tell me in which OS/browser combinations this happens? Just did a double check (for my own sanity as I could swear I've seen it working haha) and clicking the wrapping label in Chrome, Firefox and IE on Windows does set the focus on the wrapped input? Or is it only for touch events?

I see, however, that some AT may have issues with it: https://www.w3.org/TR/2008/WD-WCAG20-TECHS-20080430/H44.html

Been advocating this as the best way in components as you don't need to generate unique id fields in re-usable components. ( ゚o゚)

Talking about for-id, may I ask what the preferred way is in React to autogenerate the ids? Have been using uuid for the job and although I have not seen anything untoward happening in terms of performance in a relatively large codebase, it feels a little over the top for the job though.

I think mentioning how to best generate these would be a great thing to add to the React a11y page as it pertains directly to applying the HTML standard in re-usable components. What do you think?

@dylanb
Copy link

dylanb commented Apr 27, 2017

@AlmeroSteyn the beauty of accessibility is: as long as it works its allowed. I just went back and tested on OS X and all the browsers are working too. I also tested iOS and that is working. So I will retract my statement.

@AlmeroSteyn
Copy link
Contributor Author

@dylanb Thanks for letting me know!

@AlmeroSteyn
Copy link
Contributor Author

@dylanb Was reading the fine print in the W3C WAI document and:

Associating labels implicitly

In some situations, form controls cannot be labeled explicitly. For example, a content author might not know the id of a form field generated by a script, or that script might not add an id at all. In this case, the label element is used as a container for both the form control and the label text, so that the two are associated implicitly. Generally, explicit labels are better supported by assistive technology.

Your recommendation to prefer explicit labeling still stands!

@dylanb
Copy link

dylanb commented May 2, 2017

@AlmeroSteyn I think that statement is a bit out of date (as was my understanding) - but you cannot go wrong with for-id :-)

@AlmeroSteyn
Copy link
Contributor Author

Just an update that I am still actively looking at this. Balancing act with day job work etc etc :-)

@AlmeroSteyn AlmeroSteyn force-pushed the a11y-docs branch 6 times, most recently from 2c94885 to 9f3164c Compare May 12, 2017 11:03
@AlmeroSteyn
Copy link
Contributor Author

AlmeroSteyn commented May 12, 2017

I have created a first draft doc. For now, there is very little code in it. Consists mainly of links showing how and some text putting it into perspective.

@spicyj @jessebeach @dylanb Would any of you be able to have a quick look at it to see if it is going in the right direction? It would be great to know before I go think up React implementations and edge cases not covered by the references for each section :-)

To cut the verbosity and make it easier at a glance ,here is the outline of the doc with only the reference links used in each section and all text stripped.

Do you perhaps miss any good reference you know of? And is deep linking OK?

Thanks so much in advance!

Why accessibility?

Standards and guidelines:

WCAG

Web Content Accessibility Guidelines

WAI-ARIA

Web Accessibility Initiative - Accessible Rich Internet Applications

Accessible forms

Labelling

Notifying the user of errors

Focus control

Keyboard focus and focus outline

Mechanisms to skip to desired content

Semantic HTML and screen readers

Skiplinks

Programmatically managing focus

keyboard-navigable JavaScript widgets

Refs to Components

react-aria-modal

More complex widgets

(https://www.w3.org/TR/wai-aria/roles)
(https://www.w3.org/TR/wai-aria/states_and_properties)

Other points for consideration

Setting the language

Setting the document title

Colour contrast

calculate an entire accessible colour palette with Colorable.

Development and testing tools

The keyboard

Development assistance

eslint-plugin-jsx-a11y

eslint-plugin-jsx-a11y

react-axe

react-axe

Testing accessibility in the browser

aXe by Deque

The Accessibility Engine

WebAIM WAVE

Web Accessibility Evaluation Tool

Accessibility inspectors and the Accessibility Tree

The Accessibility Tree

Automated accessibility testing

aXe-core

Screen readers

NVDA in FireFox

NonVisual Desktop Access

VoiceOver in Safari

JAWS in Internet Explorer

Job Access With Speech

Testing colour contrast

@dylanb
Copy link

dylanb commented May 12, 2017

This is a good set of links.

In toolsets like React (SPAs), the largest single problem is focus management. The reason this is different from normal keyboard and focus management is because the framework can/will change the DOM out from under the user and focus gets lost. It is also non-trivial to solve this problem in a React application. The focus management section needs to cover this as it is not covered well enough by the content you currently link to.

@jessebeach
Copy link
Contributor

The list of links is spot on. I really don't think you need much text around them. Any text should either answer:

  1. Why is this important?; or
  2. What problem am I solving?

Let W3C, WCAG, WAI-ARIA do the heavy lifting of background info and moralizing. This doc is a pragmatic list of tools and solutions.

@AlmeroSteyn
Copy link
Contributor Author

@dylanb Hmmm maybe it is because I try not go crazy with the DOM because of a11y but have not had much trouble with this myself in React. It seems to leave DOM elements untouched if there are not wild changes. Then again our apps are not wildly widget driven but focus more on forms and validation. Could you perhaps illustrate with a specific example? Would love to add that.

I have had far more issues with ARIA live regions not firing when they should even when the DOM seems untouched. Worked it out here http://almerosteyn.com/2017/03/accessible-react-navigation and had to add timeouts or it would only work in Chrome with NVDA.

@AlmeroSteyn
Copy link
Contributor Author

@jessebeach Thank you for taking time to look at it!

I will align the doc to that. and get back to you once there is a new draft.

@pedrottimark
Copy link
Contributor

cross-reference to New Docs issue #8060

@AlmeroSteyn AlmeroSteyn force-pushed the a11y-docs branch 2 times, most recently from 3548707 to c054a06 Compare June 9, 2017 08:04
@AlmeroSteyn
Copy link
Contributor Author

Sorry for taking so long to get to the first review changes.

@jessebeach I have stripped the text down and focussed on the links.

As suggested by @dylanb I did go into more detail in the Focus Management section.

Please let me know what you think of where it is now. And is the Focus Management section explanatory enough?


## Why accessibility?

Web accessibility (also referred to as [**a11y**](https://en.wiktionary.org/wiki/a11y)) is the design and creation of websites that can be used by everyone. People who experience disabilities only fully benefit from websites when
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Accessibility support is necessary to allow assistive technology to interpret web pages."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"People who experience disabilities only fully benefit from websites when they include accessibility features".

This phrase feels a bit contentious. I can't come up with a phrasing that doesn't have "othering" connotations or undertones of condescension. Let's just stick with a factful sentence about the technology as written above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I was struggling with this myself when I wrote it. Trying to avoid 'othering' while coming up with something that would speak to the developer who so not know about a11y yet. This one won then but your signal is clear enough that the vote should have gone the other way. Thank you! Fixed in the next push.

Copy link
Contributor

@jessebeach jessebeach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few editing suggestions.

Overall, the content looks great. I think we're just about ready to ship this.


The [Web Content Accessibility Guidelines](https://www.w3.org/WAI/intro/wcag) provides guidelines for creating accessible web sites.

The following WCAG checklists can help in getting an overview:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The following WCAG checklists provide an overview"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in next push.

- [WebAIM shows us how to label elements](http://webaim.org/techniques/forms/controls)
- [The Paciello Group explains accessible names](https://www.paciellogroup.com/blog/2017/04/what-is-an-accessible-name/)

Although these standard HTML practices can be directly introduced into React, note that the `for` attribute is written as `htmlFor` in JSX:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"directly used in React"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in next push.


### Mechanisms to skip to desired content

Provide a mechanism to allow users to skip past content sections in your application as this assists and speeds up keyboard navigation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip past navigation sections, not content sections, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Meant that, as in jump past sections I am not interested in. Fixed in next push :-)


- [Deque University - HTML 5 and ARIA Landmarks](https://dequeuniversity.com/assets/html/jquery-summit/html5/slides/landmarks.html)

#### Skiplinks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a duplicate of section "Mechanisms to skip to desired content" above. Combine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently a subsection of that section, together with Semantic HTML and screen readers. There I meant to convey that you can skip to these elements using the screen readers (like the rotor in VoiceOver). I have now combined both into the upper section. What do you think? Changed in the next push.

### Programmatically managing focus

Our React applications continuously modify the HTML DOM during runtime, sometimes leading to keyboard focus being lost or set to an unexpected element. In order to repair this,
we need to programmatically nudge the keyboard focus in the right direction. For example by resetting keyboard focus to a button that opened a modal window after it was closed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"after that modal window is closed".

Dereference the anaphor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in next push.


To set focus in React, we can use [Refs to Components](refs-and-the-dom.html) or [ReactDOM](react-dom.html).

Using refs:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hesitant to include this example. We really shouldn't encourage folks to call focus on an element on an onClick event.

Maybe remove the example code and just point to react-aria-modal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I had a different example but I ended up using this one as this exact example exists on the refs page in the docs. Perhaps it should be looked at, at some stage then.

I want to try and propose a compromise. And know when I started up with React this was something that took a while to sink in. So I have cut down the code to just show how you focus, instead of showing where you put the code. I still think that maybe it could help to get devs started quicker with focus management.

What do you think of the new code examples? If you still feel edgy about it I will remove it :-)

Changed in next push.

the cancel button (preventing the keyboard user from accidentally activating the success action) and trap keyboard focus inside the modal, it also resets focus back to the element that
initially triggered the modal.

**Note:** While this is a very important accessibility feature, it is also a technique that should be used judiciously. Use it to repair the keyboard focus flow when it is disturbed, not to try and anticipate how
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for including this note :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

A number of tools exist that can run accessibility audits on web pages in your browser. Please use them in combination with other accessibility checks mentioned here as they can only
test the technical accessibility of your HTML.

#### aXe by Deque
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be rolled into thereact-axe section above.

Copy link
Contributor Author

@AlmeroSteyn AlmeroSteyn Jun 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I have rolled all aXe related things into one section. All under the heading of Testing accessibility in the browser. As axe-core uses a browser DOM this is technically correct. Changed in next push.

- [Activate the Accessibility Inspector in Chrome](https://gist.github.com/marcysutton/0a42f815878c159517a55e6652e3b23a)
- [Using the Accessibility Inspector in OS X Safari](https://developer.apple.com/library/content/documentation/Accessibility/Conceptual/AccessibilityMacOSX/OSXAXTestingApps.html)

### Automated accessibility testing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, could be rolled into the react-axe section above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

- [WebAIM - Using JAWS to Evaluate Web Accessibility](http://webaim.org/articles/jaws/)
- [Deque - JAWS Keyboard Shortcuts](https://dequeuniversity.com/screenreaders/jaws-keyboard-shortcuts)

### Testing colour contrast
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be rolled into the "Colour contrast" section above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Fixed in next push

@AlmeroSteyn
Copy link
Contributor Author

@jessebeach Thank you so so much for the fast and detailed review. Really glad you liked it and quite excited to get this into the docs!

I have made all the changes requested. The major ones requiring another review are:

  1. I rolled all the info to skip to page locations into one section.
  2. I redid the code examples in the Focus Management section. Please have a look at these and if you think that these can go in. More detailed explanation of why I did it in my comment on the review comment.
  3. I rolled all aXe items into one section.
  4. I rolled the colour contrast tests into the colour contrast section.

Please let me know if there is anything else left to change. I'll get to it ASAP.

@AlmeroSteyn
Copy link
Contributor Author

If there is anything still outstanding on this PR I can pick it up ASAP to get it ready :-)

Copy link
Contributor

@jessebeach jessebeach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an awesome one-pager on modern accessibility development practice. Thank you @AlmeroSteyn !!

I had two nit comments. Nothing to delay an approve.

@gaearon, have your requested changes been addressed?

## Accessible forms

### Labelling
Every HTML form contol, such as `<input>` and `<textarea>`, needs to be labelled accessibly. We need to provide descriptive labels that are not only visible but also exposed to screen readers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"but ARE also exposed to screen readers".

Maybe just cut the last sentence altogether. Up to you. Labels aren't required to be visible, although it's definitely preferred.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm good one. Left the sentence but cut the visible bit so as not to indicate something is dogma when it isn't. Also saw I invented a new word form contol which I then fixed.

}
```

Or we could use ReactDOM to directly find and focus the element without a ref:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spicyj, is ReactDOM.findDOMNode discourage in the latest best practice?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's discouraged. Let's leave this out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the example.


We can set this in React using the [React Document Title Component](https://github.com/gaearon/react-document-title).

### Colour contrast
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: let's use American spelling everywhere for consistency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the ones I could find not being American hehe

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go after these nits are addressed.
Thanks so much to both of you!

- "docs/index.html"
---

## Why accessibility?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: we generally use Capitalized Style for large headers. So that would be "Why Accessibility?"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


React fully supports building accessible websites, often by using standard HTML techniques.

## Standards and guidelines:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: no : in headers. Let's change to "Standards and Guidelines"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


The [Web Accessibility Initiative - Accessible Rich Internet Applications](https://www.w3.org/WAI/intro/aria) document contains techniques for building fully accessible JavaScript widgets.

Note that all `aria-*` HTML attributes are fully supported in JSX.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need a tiny one-line example here because they use a different convention than other JSX props.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to include the following:

image


Note that all `aria-*` HTML attributes are fully supported in JSX.

## Accessible forms
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Accessible Forms

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

<input id="namedInput" type="text" name="name"/>
```

### Notifying the user of errors
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: it's fine to not capitalize headers with ### and more so this one is good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted. Also stepped through all ## headers and capitalized where required.


<center><img src="/react/img/docs/keyboard-focus.png" alt="Blue keyboard focus outline around a selected link." /></center>

Only ever use CSS that removes this outline, for example by setting `outline:0`, if you are replacing it with another focus outline implementation.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: space (outline: 0)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


The Mozilla Developer Network takes a look at this and describes how we can build [keyboard-navigable JavaScript widgets](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets).

To set focus in React, we can use [Refs to Components](refs-and-the-dom.html) or [ReactDOM](react-dom.html).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove ReactDOM reference here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the example.

the cancel button (preventing the keyboard user from accidentally activating the success action) and trap keyboard focus inside the modal, it also resets focus back to the element that
initially triggered the modal.

**Note:** While this is a very important accessibility feature, it is also a technique that should be used judiciously. Use it to repair the keyboard focus flow when it is disturbed, not to try and anticipate how
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have existing styling format for notes:

> Note:
>
> (note text)

Let's use it here too.
The "Note:" will be bolded automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!! Fixed.

@AlmeroSteyn
Copy link
Contributor Author

AlmeroSteyn commented Jun 23, 2017

I have made the requested changes.

@jessebeach , @gaearon Thank you so much for the detailed reviews here. Know you are busy so this is very much appreciated. React is such a pleasure to work with not only because of the tech itself but also because of the openness and attitude of the community.


Ensure that your web application can be fully operated with the keyboard only:

- [WebAIM talks about keyboard accessibility](https://webaim.org/techniques/keyboard/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cert failed for me here, does this website support SSL?

Copy link
Contributor

@nhunzaker nhunzaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No real suggestions or changes on my end, other than the https thing. This this is a fantastic doc, and I wish every developer would read it.

Amazing work!

@gaearon gaearon merged commit 2675ce1 into facebook:master Jun 26, 2017
@gaearon
Copy link
Collaborator

gaearon commented Jun 26, 2017

Thank you very much!

@AlmeroSteyn
Copy link
Contributor Author

@nhunzaker thank you so much for that comment!

@gaearon this was only a pleasure to put together.

gaearon pushed a commit that referenced this pull request Jun 26, 2017
* [Docs: A11y] Add accessibility docs

* Fix the link

* Replace link image

* Tweak style
@AlmeroSteyn AlmeroSteyn deleted the a11y-docs branch June 30, 2017 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants