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 committed Aug 22, 2017
1 parent b908042 commit 7c8085c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# react-modal
k react-modal

Accessible modal dialog component for React.JS

Expand Down 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 convenience prop contentLabel to add aria-label 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 @@ -93,7 +93,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 @@ -55,7 +55,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 7c8085c

Please sign in to comment.