From 919daa33d1c2b0e1cb2b780a5a4ba561f2fff13b Mon Sep 17 00:00:00 2001 From: Clay Diffrient Date: Fri, 7 Oct 2016 20:06:47 -0600 Subject: [PATCH] [fixed] Remove the default aria role dialog This has several accessibility concerns although well intentioned. closes #237 --- lib/components/Modal.js | 3 ++- specs/Modal.spec.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/components/Modal.js b/lib/components/Modal.js index 43401344..3bd28dd5 100644 --- a/lib/components/Modal.js +++ b/lib/components/Modal.js @@ -36,7 +36,8 @@ var Modal = React.createClass({ onRequestClose: React.PropTypes.func, closeTimeoutMS: React.PropTypes.number, ariaHideApp: React.PropTypes.bool, - shouldCloseOnOverlayClick: React.PropTypes.bool + shouldCloseOnOverlayClick: React.PropTypes.bool, + role: React.PropTypes.string }, getDefaultProps: function () { diff --git a/specs/Modal.spec.js b/specs/Modal.spec.js index 66453bd7..31b9a22b 100644 --- a/specs/Modal.spec.js +++ b/specs/Modal.spec.js @@ -58,9 +58,9 @@ describe('Modal', function () { unmountModal(); }); - it('renders the modal content with a dialog aria role ', function () { + it('renders the modal content with a dialog aria role when provided ', function () { var child = 'I am a child of Modal, and he has sent me here...'; - var component = renderModal({isOpen: true}, child); + var component = renderModal({isOpen: true, role: 'dialog'}, child); equal(component.portal.refs.content.getAttribute('role'), 'dialog'); unmountModal(); });