File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,8 @@ var ModalPortal = module.exports = React.createClass({
142
142
render : function ( ) {
143
143
return this . shouldBeClosed ( ) ? div ( ) : (
144
144
div ( {
145
- className : this . buildClassName ( 'overlay' ) ,
145
+ ref : "overlay" ,
146
+ className : cx ( this . buildClassName ( 'overlay' ) , this . props . overlayClassName ) ,
146
147
style : this . overlayStyles ,
147
148
onClick : this . handleOverlayClick
148
149
} ,
Original file line number Diff line number Diff line change @@ -104,6 +104,12 @@ describe('Modal', function () {
104
104
unmountModal ( ) ;
105
105
} ) ;
106
106
107
+ it ( 'supports overlayClassName' , function ( ) {
108
+ var modal = renderModal ( { isOpen : true , overlayClassName : 'myOverlayClass' } ) ;
109
+ equal ( modal . portal . refs . overlay . getDOMNode ( ) . className . contains ( 'myOverlayClass' ) , true ) ;
110
+ unmountModal ( ) ;
111
+ } ) ;
112
+
107
113
it ( 'adds --after-open for animations' , function ( ) {
108
114
var modal = renderModal ( { isOpen : true } ) ;
109
115
var overlay = document . querySelector ( '.ReactModal__Overlay' ) ;
You can’t perform that action at this time.
0 commit comments