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 block] Unexpected behavior while decreasing number of columns #7149

Closed
SofiaSousa opened this issue Jun 5, 2018 · 9 comments
Closed
Labels
[Block] Columns Affects the Columns Block [Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Milestone

Comments

@SofiaSousa
Copy link
Contributor

SofiaSousa commented Jun 5, 2018

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
@GlennMartin1
Copy link

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

The content can be removed manually.

@chrisvanpatten
Copy link
Contributor

chrisvanpatten commented Jun 5, 2018

@GlennMartin1 do you have a link to that issue?

@chrisvanpatten
Copy link
Contributor

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.

@GlennMartin1
Copy link

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

@chrisvanpatten
Copy link
Contributor

@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.

@gschoppe
Copy link

gschoppe commented Jun 6, 2018

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.

@mtias
Copy link
Member

mtias commented Jul 19, 2018

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.

@mtias mtias added [Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended labels Jul 19, 2018
@mtias mtias added this to the Future: 5.1 milestone Nov 12, 2018
@strarsis
Copy link
Contributor

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.

@iandunn iandunn added the [Block] Columns Affects the Columns Block label Jun 3, 2019
@youknowriad
Copy link
Contributor

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

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 [Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

8 participants