Skip to content

Commit 57b6d76

Browse files
authored
Fix wrong sentences line break
1 parent 1f27bba commit 57b6d76

File tree

1 file changed

+13
-26
lines changed

1 file changed

+13
-26
lines changed

content/docs/accessibility.md

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ Only ever use CSS that removes this outline, for example by setting `outline: 0`
149149

150150
Provide a mechanism to allow users to skip past navigation sections in your application as this assists and speeds up keyboard navigation.
151151

152-
Skiplinks or Skip Navigation Links are hidden navigation links that only become visible when keyboard users interact with the page. They are very easy to implement with
153-
internal page anchors and some styling:
152+
Skiplinks or Skip Navigation Links are hidden navigation links that only become visible when keyboard users interact with the page. They are very easy to implement with internal page anchors and some styling:
154153

155154
- [WebAIM - Skip Navigation Links](https://webaim.org/techniques/skipnav/)
156155

@@ -162,8 +161,7 @@ Read more about the use of these elements to enhance accessibility here:
162161

163162
### Programmatically managing focus {#programmatically-managing-focus}
164163

165-
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,
166-
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 that modal window is closed.
164+
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 that modal window is closed.
167165

168166
MDN Web Docs 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).
169167

@@ -201,8 +199,7 @@ Then we can focus it elsewhere in our component when needed:
201199
}
202200
```
203201

204-
Sometimes a parent component needs to set focus to an element in a child component. We can do this by [exposing DOM refs to parent components](/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components)
205-
through a special prop on the child component that forwards the parent's ref to the child's DOM node.
202+
Sometimes a parent component needs to set focus to an element in a child component. We can do this by [exposing DOM refs to parent components](/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components) through a special prop on the child component that forwards the parent's ref to the child's DOM node.
206203

207204
```javascript{4,12,16}
208205
function CustomTextInput(props) {
@@ -229,12 +226,10 @@ class Parent extends React.Component {
229226
this.inputElement.current.focus();
230227
```
231228

232-
When using a HOC to extend components, it is recommended to [forward the ref](/docs/forwarding-refs.html) to the wrapped component using the `forwardRef` function of React. If a third party HOC
233-
does not implement ref forwarding, the above pattern can still be used as a fallback.
229+
When using a HOC to extend components, it is recommended to [forward the ref](/docs/forwarding-refs.html) to the wrapped component using the `forwardRef` function of React. If a third party HOC does not implement ref forwarding, the above pattern can still be used as a fallback.
234230

235231
A great focus management example is the [react-aria-modal](https://github.com/davidtheclark/react-aria-modal). This is a relatively rare example of a fully accessible modal window. Not only does it set initial focus on
236-
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
237-
initially triggered the modal.
232+
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.
238233

239234
>Note:
240235
>
@@ -243,8 +238,7 @@ initially triggered the modal.
243238
244239
## Mouse and pointer events {#mouse-and-pointer-events}
245240

246-
Ensure that all functionality exposed through a mouse or pointer event can also be accessed using the keyboard alone. Depending only on the pointer device will lead to many cases where
247-
keyboard users cannot use your application.
241+
Ensure that all functionality exposed through a mouse or pointer event can also be accessed using the keyboard alone. Depending only on the pointer device will lead to many cases where keyboard users cannot use your application.
248242

249243
To illustrate this, let's look at a prolific example of broken accessibility caused by click events. This is the outside click pattern, where a user can disable an opened popover by clicking outside the element.
250244

@@ -301,8 +295,7 @@ constructor(props) {
301295
}
302296
```
303297

304-
This may work fine for users with pointer devices, such as a mouse, but operating this with the keyboard alone leads to broken functionality when tabbing to the next element
305-
as the `window` object never receives a `click` event. This can lead to obscured functionality which blocks users from using your application.
298+
This may work fine for users with pointer devices, such as a mouse, but operating this with the keyboard alone leads to broken functionality when tabbing to the next element as the `window` object never receives a `click` event. This can lead to obscured functionality which blocks users from using your application.
306299

307300
<img src="../images/docs/outerclick-with-keyboard.gif" alt="A toggle button opening a popover list implemented with the click outside pattern and operated with the keyboard showing the popover not being closed on blur and it obscuring other screen elements." />
308301

@@ -368,18 +361,15 @@ class BlurExample extends React.Component {
368361
}
369362
```
370363

371-
This code exposes the functionality to both pointer device and keyboard users. Also note the added `aria-*` props to support screen-reader users. For simplicity's sake
372-
the keyboard events to enable `arrow key` interaction of the popover options have not been implemented.
364+
This code exposes the functionality to both pointer device and keyboard users. Also note the added `aria-*` props to support screen-reader users. For simplicity's sake the keyboard events to enable `arrow key` interaction of the popover options have not been implemented.
373365

374366
<img src="../images/docs/blur-popover-close.gif" alt="A popover list correctly closing for both mouse and keyboard users." />
375367

376-
This is one example of many cases where depending on only pointer and mouse events will break functionality for keyboard users. Always testing with the keyboard will immediately
377-
highlight the problem areas which can then be fixed by using keyboard aware event handlers.
368+
This is one example of many cases where depending on only pointer and mouse events will break functionality for keyboard users. Always testing with the keyboard will immediately highlight the problem areas which can then be fixed by using keyboard aware event handlers.
378369

379370
## More Complex Widgets {#more-complex-widgets}
380371

381-
A more complex user experience should not mean a less accessible one. Whereas accessibility is most easily achieved by coding as close to HTML as possible,
382-
even the most complex widget can be coded accessibly.
372+
A more complex user experience should not mean a less accessible one. Whereas accessibility is most easily achieved by coding as close to HTML as possible, even the most complex widget can be coded accessibly.
383373

384374
Here we require knowledge of [ARIA Roles](https://www.w3.org/TR/wai-aria/#roles) as well as [ARIA States and Properties](https://www.w3.org/TR/wai-aria/#states_and_properties).
385375
These are toolboxes filled with HTML attributes that are fully supported in JSX and enable us to construct fully accessible, highly functional React components.
@@ -438,16 +428,13 @@ By far the easiest and also one of the most important checks is to test if your
438428

439429
### Development assistance {#development-assistance}
440430

441-
We can check some accessibility features directly in our JSX code. Often intellisense checks are already provided in JSX aware IDE's for the ARIA roles, states and properties. We also
442-
have access to the following tool:
431+
We can check some accessibility features directly in our JSX code. Often intellisense checks are already provided in JSX aware IDE's for the ARIA roles, states and properties. We also have access to the following tool:
443432

444433
#### eslint-plugin-jsx-a11y {#eslint-plugin-jsx-a11y}
445434

446-
The [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y) plugin for ESLint provides AST linting feedback regarding accessibility issues in your JSX. Many
447-
IDE's allow you to integrate these findings directly into code analysis and source code windows.
435+
The [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y) plugin for ESLint provides AST linting feedback regarding accessibility issues in your JSX. Many IDE's allow you to integrate these findings directly into code analysis and source code windows.
448436

449-
[Create React App](https://github.com/facebookincubator/create-react-app) has this plugin with a subset of rules activated. If you want to enable even more accessibility rules,
450-
you can create an `.eslintrc` file in the root of your project with this content:
437+
[Create React App](https://github.com/facebookincubator/create-react-app) has this plugin with a subset of rules activated. If you want to enable even more accessibility rules, you can create an `.eslintrc` file in the root of your project with this content:
451438

452439
```json
453440
{

0 commit comments

Comments
 (0)