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

Query Block isn't fully deleted after initial removal #31961

Closed
annezazu opened this issue May 19, 2021 · 2 comments
Closed

Query Block isn't fully deleted after initial removal #31961

annezazu opened this issue May 19, 2021 · 2 comments
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Bug An existing feature does not function as intended

Comments

@annezazu
Copy link
Contributor

Description

When deleting the query block after selecting one of the newer patterns, the Query Block isn't fully deleted. Instead it must go through an additional deletion process to properly remove it. cc @kjellr @ntsekouras as I think this is due to adding in patterns somehow. This only seems to happen if you browse through the different pattern options, select one, and then delete the query block. In case it helps, this feels very similar to this button block issue where phantom buttons appear after deletion due to the template a button block lives in: #28217

Just to add some more detail, the buttons block uses a template currently—when a buttons block is empty the template is used to create an empty singular button inside of buttons. That template is also created when first adding a buttons block.

Strangely, this doesn't happen with every single pattern as you can see in the video below.

Step-by-step reproduction instructions

  1. Add in the Query Block
  2. Try selecting different patterns from the setup screen.
  3. Delete the block after selecting. Notice that for some patterns, the Query Block isn't deleted upon removal but instead either leads to a) the setup screen returning b) a different, simpler pattern appearing.

Expected behaviour

Expect for the Query Block to be deleted.

Actual behaviour

Query block is not deleted fully.

Screenshots or screen recording (optional)

This video shows the full experience running from the problem not occurring (query block deleting without any issues), the query block deletion leading to a return to the setup screen, and the query block deletion leading to a seemingly simplified pattern rather than removal:

Screen.Recording.2021-05-18.at.6.02.48.PM.mov

WordPress information

  • WordPress version: WordPress 5.7.2
  • Gutenberg version: 10.6.1
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? TT1 Blocks

Device information

  • Device: Desktop
  • Operating system: MacOS
  • Browser: Chrome.
@annezazu annezazu added [Type] Bug An existing feature does not function as intended [Block] Query Loop Affects the Query Loop Block labels May 19, 2021
@ntsekouras
Copy link
Contributor

Hey I understand the confusion here as the Query and Loop blocks use the same icon. Yet, we haven't implemented a way of having some blocks as passthrough (although I'm not sure we would want to eventually for this one) and the icons had been changed to be the same.

So what you're deleting in these cases is the Loop and since the parent Query block doesn't have any innerBlocks, that's why it shows the placeholder.

and the query block deletion leading to a seemingly simplified pattern rather than removal:

This one I couldn't reproduce and understand why it was happening though...

@annezazu
Copy link
Contributor Author

Oh wow! Makes perfect sense. I could have sworn I was selecting the Query block rather than the Loop. Thanks for the wider context. I'll go ahead and close this out since it's more user error than anything else and anything that could be reported comes down to the experience of nested blocks, which is already well documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants