diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index c9d43a590c0d9a..43fdce5203a0ea 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -392,6 +392,11 @@ function render_block_core_navigation( $attributes, $content, $block ) { wp_enqueue_script( 'wp-block-navigation-view' ); } + $should_load_modal_view_script = isset( $attributes['overlayMenu'] ) && 'never' !== $attributes['overlayMenu']; + if ( $should_load_modal_view_script ) { + wp_enqueue_script( 'wp-block-navigation-view-modal' ); + } + $inner_blocks = $block->inner_blocks; // Ensure that blocks saved with the legacy ref attribute name (navigationMenuId) continue to render.