Skip to content

Commit

Permalink
[fixed] added missed 'aria-label' prop type validation for 'ModalHeader'
Browse files Browse the repository at this point in the history
and doc description for it
  • Loading branch information
AlexKVal committed Jul 23, 2015
1 parent 206a0a3 commit 86d3feb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ModalHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class ModalHeader extends React.Component {
{ this.props.closeButton &&
<button
className='close'
aria-label={this.props['aria-label'] || 'Close'} //eslint-disable-line react/prop-types
onClick={this.props.onHide}
>
<span aria-hidden="true">
Expand All @@ -31,6 +30,11 @@ class ModalHeader extends React.Component {
ModalHeader.__isModalHeader = true;

ModalHeader.propTypes = {
/**
* The 'aria-label' attribute is used to define a string that labels the current element.
* It is used for Assistive Technology when the label text is not visible on screen.
*/
'aria-label': React.PropTypes.string,
/**
* A css class applied to the Component
*/
Expand All @@ -47,6 +51,7 @@ ModalHeader.propTypes = {
};

ModalHeader.defaultProps = {
'aria-label': 'Close',
modalClassName: 'modal-header',
closeButton: false
};
Expand Down

0 comments on commit 86d3feb

Please sign in to comment.