@@ -18,6 +18,8 @@ var CLASS_NAMES = {
18
18
}
19
19
} ;
20
20
21
+ var OVERLAY_STYLES = { position : 'fixed' , left : 0 , right : 0 , top : 0 , bottom : 0 } ;
22
+
21
23
function stopPropagation ( event ) {
22
24
event . stopPropagation ( ) ;
23
25
}
@@ -102,7 +104,7 @@ var ModalPortal = module.exports = React.createClass({
102
104
} ,
103
105
104
106
handleKeyDown : function ( event ) {
105
- if ( event . keyCode == 9 /*tab*/ ) scopeTab ( this . getDOMNode ( ) , event ) ;
107
+ if ( event . keyCode == 9 /*tab*/ ) scopeTab ( this . refs . content . getDOMNode ( ) , event ) ;
106
108
if ( event . keyCode == 27 /*esc*/ ) this . requestClose ( ) ;
107
109
} ,
108
110
@@ -126,8 +128,6 @@ var ModalPortal = module.exports = React.createClass({
126
128
return ! this . props . isOpen && ! this . state . beforeClose ;
127
129
} ,
128
130
129
- overlayStyles : { position : 'fixed' , left : 0 , right : 0 , top : 0 , bottom : 0 } ,
130
-
131
131
buildClassName : function ( which ) {
132
132
var className = CLASS_NAMES [ which ] . base ;
133
133
if ( this . state . afterOpen )
@@ -142,7 +142,7 @@ var ModalPortal = module.exports = React.createClass({
142
142
div ( {
143
143
ref : "overlay" ,
144
144
className : cx ( this . buildClassName ( 'overlay' ) , this . props . overlayClassName ) ,
145
- style : this . overlayStyles ,
145
+ style : OVERLAY_STYLES ,
146
146
onClick : this . handleOverlayClick
147
147
} ,
148
148
div ( {
0 commit comments