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

Columns: Remove empty html render for columns block #67297

Conversation

Infinite-Null
Copy link
Contributor

Part of : #63332

What?

Prevents empty HTML markup generation for columns blocks that have no inner blocks.

Why?

This PR addresses an edge case where columns block wrappers continue to render empty HTML markup on the website even after there is no inner block content.

Testing Instructions

  1. Create a new post.
  2. Add a columns block.
  3. Add an empty column block, and save.

View the post on the front, and view the source.

Screencast

Before patch

Screen.Recording.2024-11-26.at.12.42.40.PM.mov

After patch

Screen.Recording.2024-11-26.at.12.40.01.PM.mov

Copy link

github-actions bot commented Nov 26, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Infinite-Null <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka
Copy link
Member

Thanks for working on this, @Infinite-Null!

I left a comment on the issue. The main point is that storing the isEmpty flag in attributes isn't the "right" solution here. I think it should be resolved at the API level first.

Let's continue the discussion on the issue.

@Mamaduka Mamaduka added [Block] Columns Affects the Columns Block [Type] Bug An existing feature does not function as intended [Status] Blocked Used to indicate that a current effort isn't able to move forward labels Nov 26, 2024
@Infinite-Null
Copy link
Contributor Author

Thanks for working on this, @Infinite-Null!

I left a comment on the issue. The main point is that storing the isEmpty flag in attributes isn't the "right" solution here. I think it should be resolved at the API level first.

Let's continue the discussion on the issue.

Hi @Mamaduka,
Thank you for pointing this out. The primary intention behind this approach was to pass a flag using an attribute, as I believed it would effectively indicate whether the blocks were empty. However, I’ll explore alternative methods to achieve this functionality. In the meantime, I will monitor and contribute to the discussions on the issue.

@Mamaduka
Copy link
Member

@Infinite-Null, I think we can close this PR since we'll have to pursue a more general approach. See the issue for details.

@Infinite-Null
Copy link
Contributor Author

@Infinite-Null, I think we can close this PR since we'll have to pursue a more general approach. See the issue for details.

Sure @Mamaduka

@Infinite-Null Infinite-Null deleted the fix/columns-empty-html-rendering branch November 29, 2024 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Columns Affects the Columns Block [Status] Blocked Used to indicate that a current effort isn't able to move forward [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants