File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,8 @@ var ModalPortal = module.exports = React.createClass({
201
201
tabIndex : "-1" ,
202
202
onKeyDown : this . handleKeyDown ,
203
203
onMouseDown : this . handleContentMouseDown ,
204
- onMouseUp : this . handleContentMouseUp
204
+ onMouseUp : this . handleContentMouseUp ,
205
+ role : "dialog"
205
206
} ,
206
207
this . props . children
207
208
)
Original file line number Diff line number Diff line change @@ -58,6 +58,13 @@ describe('Modal', function () {
58
58
unmountModal ( ) ;
59
59
} ) ;
60
60
61
+ it ( 'renders the modal content with a dialog aria role ' , function ( ) {
62
+ var child = 'I am a child of Modal, and he has sent me here...' ;
63
+ var component = renderModal ( { isOpen : true } , child ) ;
64
+ equal ( component . portal . refs . content . getAttribute ( 'role' ) , 'dialog' ) ;
65
+ unmountModal ( ) ;
66
+ } ) ;
67
+
61
68
it ( 'has default props' , function ( ) {
62
69
var node = document . createElement ( 'div' ) ;
63
70
Modal . setAppElement ( document . createElement ( 'div' ) ) ;
You can’t perform that action at this time.
0 commit comments