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

Update Drawer.mdx #3087

Merged
merged 1 commit into from Nov 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 2 additions & 15 deletions docs/src/docs/core/Drawer.mdx
Expand Up @@ -64,21 +64,8 @@ By default:
- When drawer is opened focus is trapped inside and document.body scroll is locked in current position
- When user clicks on overlay or presses escape drawer is closed
- Drawer transitions use disabled when user prefers to reduce motion
- Drawer body has `aria-modal` and `role="dialog"` attributes

Add [aria-labelledby](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby), [aria-describedby](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby)
and `closeButtonLabel` props for better screen readers support:

```tsx
<Drawer
aria-labelledby="drawer-title"
aria-describedby="drawer-body"
closeButtonLabel="Close drawer"
>
<h1 id="drawer-title">Title</h1>
<div id="drawer-body">Body</div>
</Drawer>
```
- Drawer wrapper has `aria-modal="true"` and `role="dialog"` attributes
- Drawer wrapper has `aria-labelledby` and `aria-describedby` pointing to drawer title and body

## Initial focus

Expand Down