Skip to content

Commit

Permalink
Don't close the overlay when hovering out of pre prendered submenus (W…
Browse files Browse the repository at this point in the history
…ordPress#60130)


Unlinked contributors: ariel-maidana.

Co-authored-by: draganescu <andraganescu@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>
Co-authored-by: SantosGuillamot <santosguillamot@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
Co-authored-by: huzaifaalmesbah <huzaifaalmesbah@git.wordpress.org>
Co-authored-by: kjnanda <krupajnanda@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org>
Co-authored-by: liviopv <liviopv@git.wordpress.org>
  • Loading branch information
11 people authored and cbravobernal committed Apr 9, 2024
1 parent abedf38 commit 93c163d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/block-library/src/navigation/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ const { state, actions } = store(
actions.openMenu( 'hover' );
},
closeMenuOnHover() {
actions.closeMenu( 'hover' );
const { type, overlayOpenedBy } = getContext();
if (
type === 'submenu' &&
// Only open on hover if the overlay is closed.
Object.values( overlayOpenedBy || {} ).filter( Boolean )
.length === 0
)
actions.closeMenu( 'hover' );
},
openMenuOnClick() {
const ctx = getContext();
Expand Down

0 comments on commit 93c163d

Please sign in to comment.