Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make navigation block submenus usable on mobile. #21471

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,6 @@ function NavigationLinkEdit( {
'core/strikethrough',
] }
/>
{ showSubmenuIcon && (
<span className="wp-block-navigation-link__submenu-icon">
<ItemSubmenuIcon />
</span>
) }
{ isLinkOpen && (
<Popover
position="bottom center"
Expand Down Expand Up @@ -285,6 +280,11 @@ function NavigationLinkEdit( {
</Popover>
) }
</div>
{ showSubmenuIcon && (
<span className="wp-block-navigation-link__submenu-icon">
<ItemSubmenuIcon />
</span>
) }
<InnerBlocks
allowedBlocks={ [ 'core/navigation-link' ] }
renderAppender={
Expand Down
6 changes: 3 additions & 3 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ function block_core_navigation_build_html( $attributes, $block, $colors, $font_s

$html .= '</span>';

$html .= '</a>';
// End anchor tag content.

// Append submenu icon to top-level item.
// it shows the icon as default, when 'showSubmenuIcon' is not set,
// or when it's set and also not False.
Expand All @@ -268,9 +271,6 @@ function block_core_navigation_build_html( $attributes, $block, $colors, $font_s
$html .= '<span class="wp-block-navigation-link__submenu-icon">' . block_core_navigation_render_submenu_icon() . '</span>';
}

$html .= '</a>';
// End anchor tag content.

if ( $has_submenu ) {
$html .= block_core_navigation_build_html( $attributes, $block, $colors, $font_sizes );
}
Expand Down
Loading