Skip to content

Commit ba81894

Browse files
bluSCALE4diasbruno
authored andcommitted
Remove required flag from contentLabel propType in Modal
Change 'set' to 'sets' in Modal.spec Update README required props section
1 parent f007aeb commit ba81894

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ To install the stable version you can use [npm](https://npmjs.org/) or [yarn](ht
2727

2828
## Usage
2929

30-
The Modal object has two required props:
30+
The Modal object has one required prop:
3131

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

3534
Example:
3635

@@ -48,6 +47,8 @@ Example:
4847
</Modal>
4948
```
5049

50+
> 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`
51+
5152
### App Element
5253

5354
The app element allows you to specify the portion

specs/Modal.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('State', () => {
9494
expect(contentAttribute(modal, 'role')).toEqual('dialog');
9595
});
9696

97-
it('set aria-label based on the contentLabel prop', () => {
97+
it('sets aria-label based on the contentLabel prop', () => {
9898
const child = 'I am a child of Modal, and he has sent me here...';
9999
const modal = renderModal({
100100
isOpen: true,

src/components/Modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default class Modal extends Component {
5656
parentSelector: PropTypes.func,
5757
aria: PropTypes.object,
5858
role: PropTypes.string,
59-
contentLabel: PropTypes.string.isRequired
59+
contentLabel: PropTypes.string
6060
};
6161
/* eslint-enable react/no-unused-prop-types */
6262

0 commit comments

Comments
 (0)