Gutenberg: [Columns block] Unexpected behavior while decreasing number of columns

Created on 5 Jun 2018  路  9Comments  路  Source: WordPress/gutenberg

I realised that when the number of columns of Column (beta) block is decreased, the Visual Editor is updated correctly but the parsed HTML isn't.

To Reproduce

  1. Add a Columns (beta) block
  2. Set more than 2 columns with some content (ex: 1, 2, 3, 4)
  3. Decrease the number of columns (in Block tab) and check the number of columns in editor is correct
  4. Check HTML (Edit as HTML option) or Save it and Preview and realise that removed columns are still there

Screenshots
2018-06-05 15 31 46

Desktop

  • OS: mac os
  • Browser chrome
  • Version 66.0.3359.18
[Block] Columns [Feature] Blocks [Type] Bug

Most helpful comment

@GlennMartin1 I've also been looking and can't find it either. Maybe it happened in Slack, and not a GitHub issue?

I think it's worth considering this a bug, or at least an opportunity for improvement.聽Asking users to manually manage HTML, especially given how easy it is to break Gutenberg when manually editing HTML (see #6826 and #7097), is a recipe for fragility.

I think it's reasonable for an end user to expect that removing a column (or any InnerBlocks layout area) will remove the corresponding content.

All 9 comments

This was discussed previously in a different issue, and it was decided to keep this behavior.

The content can be removed manually.

@GlennMartin1 do you have a link to that issue?

It's also worth noting that this issue exists in all InnerBlocks implementations. If you're programatically managing your InnerBlocks layout areas, removing a layout area does not remove the corresponding HTML.

I just spent 10 minutes looking for that conversation, but I can't locate it - sorry.

@GlennMartin1 I've also been looking and can't find it either. Maybe it happened in Slack, and not a GitHub issue?

I think it's worth considering this a bug, or at least an opportunity for improvement.聽Asking users to manually manage HTML, especially given how easy it is to break Gutenberg when manually editing HTML (see #6826 and #7097), is a recipe for fragility.

I think it's reasonable for an end user to expect that removing a column (or any InnerBlocks layout area) will remove the corresponding content.

I think it's reasonable for an end user to expect that removing a column (or any InnerBlocks layout area) will remove the corresponding content.

Keeping this content also poses even more issues for WordPress search. For example, If the removed column contained information about kazoos, and kazoos are mentioned nowhere else on the page, when a user runs a search at http://example.com?s=kazoos, the page will show up, despite having no kazoo-related content.

I agree this should be a bug, I don't remember the specifics of past conversations. I think at some point Columns retained the content during the editor session, so that if you removed one by mistake, it would still be easily restorable as you drag the column count. But after that it should not be saved.

Also it should be possible to remove a particular column in midst the other columns or
moving columns around. Currently this is only possible either by elaborately copying + pasting each column content or editing the code directly.

This seems like a duplicate of #7149 (or the other way around). I'm going to close this one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wpalchemist picture wpalchemist  路  3Comments

youknowriad picture youknowriad  路  3Comments

jasmussen picture jasmussen  路  3Comments

BE-Webdesign picture BE-Webdesign  路  3Comments

nylen picture nylen  路  3Comments