Sticky group, while logged in: Content is visible above the group on small screens #47566
Labels
[Block] Group
Affects the Group Block (and row, stack and grid variants)
[Type] Bug
An existing feature does not function as intended
Description
When you are logged in, the sticky group block uses the -
-wp-admin--admin-bar--height
to set thetop
value.top: calc(0px + var(--wp-admin--admin-bar--height, 0px));
But at 600px width, the wp admin bar is no longer fixed, and it moves as you scroll.
Because the group is still sticky at this width, it sits 46px down from the top even though the admin bar is no longer visible.
The page content can be seen in this space as you scroll.
The video shows the Chrome dev tools, but I have also tested this with an android phone (also using chrome)
Step-by-step reproduction instructions
Activate Gutenberg trunk.
Please make sure that your WP install is set to show the admin bar.
In the site editor, add a group block at the very top.
Open the block settings, and select position, sticky.
Make sure there is some content on the rest of the page. Using two different background colors makes the bug easier to see.
Save and view the front of the site.
Reduce the browser window width to 600px or less.
Scroll. Confirm that the WP admin bar moves, but the sticky group does not.
As you scroll, the content on the page is visible between the sticky group and the top of the browser window.
Screenshots, screen recording, code snippet
Screen.Recording.2023-01-30.at.16.51.20.mov
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: