@@ -18,6 +18,8 @@ var CLASS_NAMES = {
1818 }
1919} ;
2020
21+ var OVERLAY_STYLES = { position : 'fixed' , left : 0 , right : 0 , top : 0 , bottom : 0 } ;
22+
2123function stopPropagation ( event ) {
2224 event . stopPropagation ( ) ;
2325}
@@ -102,7 +104,7 @@ var ModalPortal = module.exports = React.createClass({
102104 } ,
103105
104106 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 ) ;
106108 if ( event . keyCode == 27 /*esc*/ ) this . requestClose ( ) ;
107109 } ,
108110
@@ -126,8 +128,6 @@ var ModalPortal = module.exports = React.createClass({
126128 return ! this . props . isOpen && ! this . state . beforeClose ;
127129 } ,
128130
129- overlayStyles : { position : 'fixed' , left : 0 , right : 0 , top : 0 , bottom : 0 } ,
130-
131131 buildClassName : function ( which ) {
132132 var className = CLASS_NAMES [ which ] . base ;
133133 if ( this . state . afterOpen )
@@ -142,7 +142,7 @@ var ModalPortal = module.exports = React.createClass({
142142 div ( {
143143 ref : "overlay" ,
144144 className : cx ( this . buildClassName ( 'overlay' ) , this . props . overlayClassName ) ,
145- style : this . overlayStyles ,
145+ style : OVERLAY_STYLES ,
146146 onClick : this . handleOverlayClick
147147 } ,
148148 div ( {
0 commit comments