@ -39,13 +39,15 @@ export default class ModalRoot extends React.PureComponent {
} else if ( ! nextProps . children ) {
} else if ( ! nextProps . children ) {
this . setState ( { revealed : false } ) ;
this . setState ( { revealed : false } ) ;
}
}
if ( ! nextProps . children && ! ! this . props . children ) {
this . activeElement . focus ( ) ;
this . activeElement = null ;
}
}
}
componentDidUpdate ( prevProps ) {
componentDidUpdate ( prevProps ) {
if ( ! this . props . children && ! ! prevProps . children ) {
if ( ! this . props . children && ! ! prevProps . children ) {
this . getSiblings ( ) . forEach ( sibling => sibling . removeAttribute ( 'inert' ) ) ;
this . getSiblings ( ) . forEach ( sibling => sibling . removeAttribute ( 'inert' ) ) ;
this . activeElement . focus ( ) ;
this . activeElement = null ;
this . handleModalClose ( ) ;
this . handleModalClose ( ) ;
}
}
if ( this . props . children ) {
if ( this . props . children ) {