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

Unable to Ungroup nested Paywall blocks #6098

Closed
dcalhoun opened this issue Aug 22, 2023 · 3 comments
Closed

Unable to Ungroup nested Paywall blocks #6098

dcalhoun opened this issue Aug 22, 2023 · 3 comments
Assignees

Comments

@dcalhoun
Copy link
Member

Steps to Reproduce

  1. Create a post with a nested Paywall block. e.g.:
    <!-- wp:group {"layout":{"type":"constrained"}} -->
    <div class="wp-block-group"><!-- wp:jetpack/paywall /--></div>
    <!-- /wp:group -->
    
  2. Select the parent block.
  3. Tap the three-dot actions button in the block toolbar.
  4. Tap "Ungroup."

Expected Outcome

The Paywall block is no longer a child of the Group block, but a sibling.

Actual Outcome

The Paywall block remains a child of the Group block.

@dcalhoun
Copy link
Member Author

A few notes from debugging...

  • It may relate to replaceBlocks not functioning as expect in this context.
  • This only appears to happen in the feature branch, so a regression was pulled in via the update Jetpack or Gutenberg refs.
  • This seems to occur for other Jetpack blocks as well (Contact Info), but not core blocks.

@dcalhoun
Copy link
Member Author

It appears a big refactor to related code occurred three months ago in WordPress/gutenberg#50385.

@dcalhoun dcalhoun self-assigned this Aug 23, 2023
@dcalhoun
Copy link
Member Author

Based on the code, it appears the inability to ungroup a hidden block type is expected behavior. When we hide the Paywall block to disable insertion via the block inserter or slash inserter, it also disables ungrouping the Paywall block (via replacing) as it is now included in the hiddenBlockTypes.

Ungrouping the Paywall block, in a way, would result in inserting the block to the root post. I believe this is why this behavior is expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant