-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Sticky positioning: nesting a sticky group block doesn't remove the sticky positioning #49903
Comments
Thanks for the ping! I don't think this is as much as bug as a side-effect of the current implementation. Sticky position only works if the sticky block is inside a scrollable container, but this isn't immediately obvious in the UI. There's some design/UX work still needed to work out the best way to make this limitation clear, so for the initial version it was easier to simply hide the controls for non-root blocks: see #47334. That's a temporary patch though; it's expected that eventually sticky position should be available for nested blocks too. Cc @andrewserong who has worked extensively on this issue. |
Thanks for opening the issue! This was a known limitation when implementing #47334 as the hiding of sticky position for not-root levels was added after the sticky position support landed. So, to prevent breakages on existing sites and block markup where folks intentionally were using sticky position in other places (relative to a container block), we still needed to respect the position value if the block wound up in a non-root position. (An example of folks affected by the hiding of non-root sticky options is in this issue: #47892) Rather than fix this bug directly, I think a better approach will be to consolidate around re-enabling sticky positioning at non-root positions and improving the UX for it. I have an early (very buggy, not yet ready for review) exploration in #49321, and the goal is to land a working version of it for 6.3. |
Awesome! Thanks for the context and sharing the game plan. I'll remove for 6.2.x. Does this makes sense to leave open from ya'll's point of view? Will do so for now but happy to defer to other issues if it makes more sense. |
I'm happy for us to leave it open, so that if it's raised again at any point prior to landing support for non-root positions, we can point folks to the discussion here. We can then close out both this and #47892 once we have a permanent solution in place, if that sounds good to everyone. |
Description
First identified in slack with props to Tommaso Pirola: Sticky positioning shouldn't be available to blocks that are nested but, if you set sticky positioning in a group block, you can still nest it in another block, like a column block, and the sticky property will remain along with the UI.
@tellthemachines can you check this out? I'm adding to the 6.2.x board for now.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Here's what happens if you drag the group into a columns block:
sticky.bug.mov
Here's what happens if you drag the group into a template part:
sticky.bug.mov
Environment info
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: