diff --git a/lib/components/ModalPortal.js b/lib/components/ModalPortal.js index 30075d6a..39c08af7 100644 --- a/lib/components/ModalPortal.js +++ b/lib/components/ModalPortal.js @@ -194,7 +194,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 6cee0450..c173399b 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'));