Skip to content

Commit

Permalink
[fixed] aria-label properly passed to the Modal header button
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Nov 14, 2015
1 parent af93b24 commit 229cb2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ModalHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import classNames from 'classnames';

class ModalHeader extends React.Component {
render() {
let { 'aria-label': label, ...props } = this.props;

return (
<div
{...this.props}
Expand All @@ -11,6 +13,7 @@ class ModalHeader extends React.Component {
<button
type="button"
className="close"
aria-label={label}
onClick={this.props.onHide}>
<span aria-hidden="true">
&times;
Expand All @@ -28,8 +31,8 @@ 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.
* The 'aria-label' attribute provides an accessible label for the close button.
* It is used for Assistive Technology when the label text is not readable.
*/
'aria-label': React.PropTypes.string,

Expand Down

0 comments on commit 229cb2c

Please sign in to comment.