File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ export default () => {
2525 afterOpenCallback . called . should . be . ok ( ) ;
2626 } ) ;
2727
28+ it ( "should call onAfterOpen with overlay and content references" , ( ) => {
29+ const afterOpenCallback = sinon . spy ( ) ;
30+ const modal = renderModal ( { isOpen : true , onAfterOpen : afterOpenCallback } ) ;
31+
32+ sinon . assert . calledWith ( afterOpenCallback , {
33+ overlayEl : modal . portal . overlay ,
34+ contentEl : modal . portal . content
35+ } ) ;
36+ } ) ;
37+
2838 it ( "should trigger the onAfterClose callback" , ( ) => {
2939 const onAfterCloseCallback = sinon . spy ( ) ;
3040 const modal = renderModal ( {
Original file line number Diff line number Diff line change @@ -208,7 +208,10 @@ export default class ModalPortal extends Component {
208208 this . setState ( { afterOpen : true } ) ;
209209
210210 if ( this . props . isOpen && this . props . onAfterOpen ) {
211- this . props . onAfterOpen ( ) ;
211+ this . props . onAfterOpen ( {
212+ overlayEl : this . overlay ,
213+ contentEl : this . content
214+ } ) ;
212215 }
213216 } ) ;
214217 }
You can’t perform that action at this time.
0 commit comments