Skip to content

Commit

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


Unlinked contributors: ariel-maidana.

Co-authored-by: draganescu <[email protected]>
Co-authored-by: scruffian <[email protected]>
Co-authored-by: SantosGuillamot <[email protected]>
Co-authored-by: annezazu <[email protected]>
Co-authored-by: fabiankaegy <[email protected]>
Co-authored-by: huzaifaalmesbah <[email protected]>
Co-authored-by: kjnanda <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: colorful-tones <[email protected]>
Co-authored-by: liviopv <[email protected]>
  • Loading branch information
11 people authored and getdave committed Mar 27, 2024
1 parent 307174c commit fed4671
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 fed4671

Please sign in to comment.