diff --git a/lib/components/ModalPortal.js b/lib/components/ModalPortal.js index 22060a1b..88d9a116 100644 --- a/lib/components/ModalPortal.js +++ b/lib/components/ModalPortal.js @@ -201,7 +201,8 @@ var ModalPortal = module.exports = React.createClass({ tabIndex: "-1", onKeyDown: this.handleKeyDown, onMouseDown: this.handleContentMouseDown, - onMouseUp: this.handleContentMouseUp + onMouseUp: this.handleContentMouseUp, + role: "dialog" }, this.props.children ) diff --git a/specs/Modal.spec.js b/specs/Modal.spec.js index 98b74016..66453bd7 100644 --- a/specs/Modal.spec.js +++ b/specs/Modal.spec.js @@ -58,6 +58,13 @@ describe('Modal', function () { unmountModal(); }); + it('renders the modal content with a dialog aria role ', function () { + var child = 'I am a child of Modal, and he has sent me here...'; + var component = renderModal({isOpen: true}, child); + equal(component.portal.refs.content.getAttribute('role'), 'dialog'); + unmountModal(); + }); + it('has default props', function() { var node = document.createElement('div'); Modal.setAppElement(document.createElement('div'));