File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,19 @@ describe('Modal', function () {
100
100
unmountModal ( ) ;
101
101
} ) ;
102
102
103
+ it ( 'keeps focus inside the modal when child has no tabbable elements' , function ( ) {
104
+ var tabPrevented = false ;
105
+ var modal = renderModal ( { isOpen : true } , 'hello' ) ;
106
+ strictEqual ( document . activeElement , modal . portal . refs . content ) ;
107
+ Simulate . keyDown ( modal . portal . refs . content , {
108
+ key : "Tab" ,
109
+ keyCode : 9 ,
110
+ which : 9 ,
111
+ preventDefault : function ( ) { tabPrevented = true ; }
112
+ } ) ;
113
+ equal ( tabPrevented , true ) ;
114
+ } ) ;
115
+
103
116
it ( 'supports custom className' , function ( ) {
104
117
var modal = renderModal ( { isOpen : true , className : 'myClass' } ) ;
105
118
equal ( modal . portal . refs . content . className . contains ( 'myClass' ) , true ) ;
You can’t perform that action at this time.
0 commit comments