Skip to content

Commit

Permalink
Remove required flag from contentLabel propType in Modal
Browse files Browse the repository at this point in the history
Change 'set' to 'sets' in Modal.spec
Update README required props section
  • Loading branch information
bluSCALE4 authored and diasbruno committed Sep 20, 2017
1 parent f007aeb commit ba81894
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ To install the stable version you can use [npm](https://npmjs.org/) or [yarn](ht

## Usage

The Modal object has two required props:
The Modal object has one required prop:

- `isOpen` to render its children.
- `contentLabel` to improve accessibility, since `v1.6.0`.

Example:

Expand All @@ -48,6 +47,8 @@ Example:
</Modal>
```

> Use the prop `contentLabel` which adds `aria-label` to the modal if there is no label text visible on the screen, otherwise specify the element including the label text using `aria-labelledby`
### App Element

The app element allows you to specify the portion
Expand Down
2 changes: 1 addition & 1 deletion specs/Modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('State', () => {
expect(contentAttribute(modal, 'role')).toEqual('dialog');
});

it('set aria-label based on the contentLabel prop', () => {
it('sets aria-label based on the contentLabel prop', () => {
const child = 'I am a child of Modal, and he has sent me here...';
const modal = renderModal({
isOpen: true,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class Modal extends Component {
parentSelector: PropTypes.func,
aria: PropTypes.object,
role: PropTypes.string,
contentLabel: PropTypes.string.isRequired
contentLabel: PropTypes.string
};
/* eslint-enable react/no-unused-prop-types */

Expand Down

0 comments on commit ba81894

Please sign in to comment.