Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jan 25, 2022
1 parent 7d568d7 commit fb3dc9b
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@ However, you can configure it to respond to the leading events (mouse down + tou

> ⚠️ In this mode, only interactions on the scrollbar of the document is ignored.
## Accessibility

By default `<ClickAwayListener />` will add an `onClick` handler to its children.
This can result in e.g. screen readers announcing the children as clickable.
However, the purpose of the `onClick` handler is not to make `children` interactive.

In order to prevent screen readers from marking non-interactive children as "clickable" add `role="presentation"` to the immediate children:

```tsx
<ClickAwayListener>
<div role="presentation">
<h1>non-interactive heading</h1>
</div>
</ClickAwayListern>
```

This is also required to fix a quirk in NVDA when using FireFox that prevents announcement of alert messages (see [mui-org/material-ui#29080](https://github.com/mui-org/material-ui/issues/29080)).

## Unstyled

- 📦 [784 B gzipped](https://bundlephobia.com/package/@mui/base@latest)
Expand Down

0 comments on commit fb3dc9b

Please sign in to comment.