File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,13 @@ export class Frame extends Component {
5959    this . nodeRef . current . removeEventListener ( 'load' ,  this . handleLoad ) ; 
6060  } 
6161
62+   onIframeLoad  =  ( )  =>  { 
63+     this . handleLoad ( ) ; 
64+     if  ( this . props . onLoad )  { 
65+       this . props . onLoad ( ) ; 
66+     } 
67+   } ; 
68+ 
6269  getDoc ( )  { 
6370    return  this . nodeRef . current  ? this . nodeRef . current . contentDocument  : null ;  // eslint-disable-line 
6471  } 
@@ -84,9 +91,6 @@ export class Frame extends Component {
8491
8592  handleLoad  =  ( )  =>  { 
8693    this . setState ( {  iframeLoaded : true  } ) ; 
87-     if  ( this . props . onLoad )  { 
88-       this . props . onLoad ( ) ; 
89-     } 
9094  } ; 
9195
9296  renderFrameContents ( )  { 
@@ -136,7 +140,7 @@ export class Frame extends Component {
136140    delete  props . contentDidUpdate ; 
137141    delete  props . forwardedRef ; 
138142    return  ( 
139-       < iframe  { ...props }  ref = { this . setRef }  onLoad = { this . handleLoad } > 
143+       < iframe  { ...props }  ref = { this . setRef }  onLoad = { this . onIframeLoad } > 
140144        { this . state . iframeLoaded  &&  this . renderFrameContents ( ) } 
141145      </ iframe > 
142146    ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments