This commit is contained in:
Albert Juhé Lluveras 2022-06-09 09:58:29 +02:00 committed by GitHub
parent d994f06803
commit b5252dbd8f
1 changed files with 11 additions and 0 deletions

View File

@ -78,6 +78,17 @@ const MiniCartBlock = ( {
setContentsNode( node );
}, [] );
useEffect( () => {
const body = document.querySelector( 'body' );
if ( body ) {
if ( isOpen ) {
Object.assign( body.style, { overflow: 'hidden' } );
} else {
Object.assign( body.style, { overflow: '' } );
}
}
}, [ isOpen ] );
useEffect( () => {
if ( contentsNode instanceof Element ) {
const container = contentsNode.querySelector(