Open ironprogrammer opened 15 hours ago
I believe the mobile site hub menu's WP Button has some old code that just navigates back.
<Button
__next40pxDefaultSize
ref={ ref }
label={ __( 'Go to Site Editor' ) }
className="edit-site-layout__view-mode-toggle"
style={ {
transform: 'scale(0.5)',
borderRadius: 4,
} }
onClick={ () => {
history.push( {} );
navigate( 'back' );
} }
>
<SiteIcon className="edit-site-layout__view-mode-toggle-icon" />
</Button>
If we fetch the dashboard link, assign it to the href, and remove the onClick handler, the issue will then be resolved.
I would like to take up this issue and come up with a corresponding PR.
Description
With a classic theme active, clicking the site icon to return to the admin dashboard yields a different result between desktop and mobile.
On desktop, the site icon returns to the dashboard. On mobile, however, it opens the site editor sidebar menu, revealing other screens that are not compatible with non-block themes. For instance, a blank page results when attempting to access Styles. The issue appears to have been introduced in 6.6 when the Patterns link was updated to resolve in the site editor.
What I expected
The expected result is that on mobile screens (728px or narrower) the site icon should return to the admin dashboard, like on desktop.
Props @kebbet for raising this in the
#core
channel.Step-by-step reproduction instructions
twentytwenty
.aria-label
attribute).Here are some test links that activate classic theme
twentytwenty
and navigate to the Patterns screen directly:Screenshots, screen recording, code snippet
Animated GIF demonstrating clicking the site icon when viewing the Patterns screen with Twenty Twenty activated:
Environment info
twentytwenty
andtwentyten
gutenberg
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.