PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/block-library/navigation.php +12 -0 24.0.0 → 24.1.0 View file →
@@ -831,8 +831,16 @@
831 831 ';
832 832 $responsive_container_content_directives = '
833 833 data-wp-watch="callbacks.focusFirstElement"
834 834 ';
835 +
836 + // The default overlay displays every submenu it contains; a custom overlay
837 + // opts out through the `disable-default-overlay` class on this container.
838 + // Submenus inherit this flag to tell the two apart, derived from the same
839 + // value as that class so the markup and the styles cannot disagree.
840 + if ( $has_custom_overlay ) {
841 + $responsive_container_directives .= ' ' . wp_interactivity_data_wp_context( array( 'hasCustomOverlay' => true ) );
842 + }
835 843 }
836 844
837 845 // Don't apply overlay inline styles if using a custom overlay template part.
838 846 // The custom overlay is responsible for its own styling.
@@ -1046,8 +1054,12 @@
1046 1054 $attributes['customBackgroundColor'] = $attributes['rgbBackgroundColor'];
1047 1055 }
1048 1056
1049 1057 unset( $attributes['rgbTextColor'], $attributes['rgbBackgroundColor'] );
1058 +
1059 + // Submenu detection is memoized while a navigation block renders. Reset it so
1060 + // the result of a previously rendered navigation block is not reused for this one.
1061 + static::$has_submenus = false;
1050 1062
1051 1063 $inner_blocks = static::get_inner_blocks( $attributes, $block );
1052 1064 // Prevent navigation blocks referencing themselves from rendering.
1053 1065 if ( gutenberg_block_core_navigation_block_tree_has_block_type(