diff --git a/packages/block-library/src/navigation/frontend.js b/packages/block-library/src/navigation/frontend.js index 592106763e4825..1bf1f9fa3a51fc 100644 --- a/packages/block-library/src/navigation/frontend.js +++ b/packages/block-library/src/navigation/frontend.js @@ -14,6 +14,10 @@ function navigationToggleModal( modal ) { triggerButton.setAttribute( 'aria-expanded', ! isHidden ); closeButton.setAttribute( 'aria-expanded', ! isHidden ); modal.classList.toggle( 'has-modal-open', ! isHidden ); + + // Add a class to indicate the modal is open. + const htmlElement = document.querySelector( 'html' ); + htmlElement.classList.toggle( 'has-modal-open' ); } MicroModal.init( {