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

Patterns: Unable to insert pattern in nested location #61381

Open
t-hamano opened this issue May 6, 2024 · 1 comment
Open

Patterns: Unable to insert pattern in nested location #61381

t-hamano opened this issue May 6, 2024 · 1 comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

t-hamano commented May 6, 2024

Description

In the latest Gutenberg, when you try to insert a pattern from the main inserter, the root block to which the block belongs is focused, even if a nested block has focus before the insertion, so the pattern is always inserted at the root level. Masu. Therefore, if you want to insert a pattern in a nested location, you must insert the pattern at the root level and then move the pattern.

Step-by-step reproduction instructions

  • Select a nested block.
  • Select a pattern category from the main inserter.
  • The canvas will zoom out and the focus should now be on the root block to which the block belongs, not on the block you selected.
  • When you insert a pattern, it should be inserted next to its root level.

Note: This issue reproduces in both the site editor and post editor. In the site editor, the canvas will zoom out when you select a pattern category from the main inserter.

Screenshots, screen recording, code snippet

Expected (WP6.5)

The pattern is inserted immediately after the block that actually has focus.

178877c55286641b253462f9ce26492a.mp4

Actual (Latest Gutenberg)

Patterns are always inserted immediately after the root block.

actual.mp4

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

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels May 6, 2024
@annezazu
Copy link
Contributor

annezazu commented May 7, 2024

Hey @t-hamano I think this is intentional alongside the work with zoomed out view right now #50739 as it focuses on adding patterns at the top level. This is something that came up on the recent hallway hangout too.

Q: By zooming out for the pattern view – does that mean that patterns aren’t still useful for smaller groups of blocks (i.e. wanting to add a CTA pattern to a column)?
These patterns are still useful! This new option is simply offering a different context and allowing you to engage with patterns in a different way. This is also something to figure out how to do to provide a level to add patterns to a specific section.

cc @richtabor and @scruffian who are working on zoomed out view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants