Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fix the Form Responses quick link disappearing from the admin bar on mobile viewports, and align its icon with the native items.
10 changes: 10 additions & 0 deletions projects/packages/forms/src/contact-form/class-contact-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,16 @@ public static function add_quick_link_to_admin_bar( \WP_Admin_Bar $admin_bar ) {
),
)
);

// On viewports <=782px, WordPress core hides every top-level admin bar item except a hardcoded
// allowlist of core nodes, so our custom node disappears. Re-show it and size the icon to match the
// native items (52px-wide box, centered ~28px glyph). The `.ab-icon` overrides use !important because
// the SVG carries its desktop sizing in an inline style attribute, which otherwise wins the cascade.
echo '<style>@media screen and (max-width: 782px){' .
'#wpadminbar li#wp-admin-bar-jetpack-forms{display:block;}' .
'#wpadminbar li#wp-admin-bar-jetpack-forms>.ab-item{display:flex;align-items:center;justify-content:center;width:52px;padding:0;}' .
'#wpadminbar li#wp-admin-bar-jetpack-forms .ab-icon{width:28px!important;height:28px!important;top:0!important;margin:0!important;}' .
'}</style>';
}

/**
Expand Down
Loading