Skip to content

Commit

Permalink
Add useEffect cleanup to remove modal class
Browse files Browse the repository at this point in the history
  • Loading branch information
renatho committed Oct 16, 2024
1 parent 0a244ec commit 0850938
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/block-library/src/navigation/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ function useResponsiveMenu( navRef ) {
} else {
htmlElement.classList.remove( 'has-modal-open' );
}

return () => {
htmlElement.classList.remove( 'has-modal-open' );
};
}, [ navRef, isResponsiveMenuOpen ] );

return [ isResponsiveMenuOpen, setResponsiveMenuVisibility ];
Expand Down

0 comments on commit 0850938

Please sign in to comment.