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

Users can create reusable 'column' block. #10679

Closed
talldan opened this issue Oct 17, 2018 · 9 comments
Closed

Users can create reusable 'column' block. #10679

talldan opened this issue Oct 17, 2018 · 9 comments
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Blocks Overall functionality of blocks [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@talldan
Copy link
Contributor

talldan commented Oct 17, 2018

Describe the bug
Since #10545 was merged it's now easy for a user to select a column in a columns block. It's also really easy to turn that selected column into a reusable block.

That reusable block can't really be used anywhere, which perhaps makes it worthless, but also it causes layout issues with the columns (see screenshot).

I'm not sure if this has always been possible or if it's a regression. If the former, I wonder if we need a supports.reusable setting in the block api to prevent this?

To Reproduce
Steps to reproduce the behavior:

  1. Add a new columns block
  2. Add some content to the columns
  3. Open the block navigation popover
  4. Select one of the 'column' blocks
  5. Using the more menu, add the column to reusable blocks
  6. Observe that the columns don't maintain their width (see screenshot)

Expected behavior
Either a) the column should not be allowed to be added as a reusable block, or b) the columns should maintain their widths

Screenshots
screen shot 2018-10-17 at 4 10 35 pm

Additional context

  • Gutenberg 4.1
@talldan talldan added [Feature] Block API API that allows to express the block paradigm. [Feature] Blocks Overall functionality of blocks [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) labels Oct 17, 2018
@slimmilkduds
Copy link

Deleted my comment since I misread ”column” as ”columns”, sorry!

@mtias
Copy link
Member

mtias commented Oct 17, 2018

Makes sense to disable this for "column".

@chrisvanpatten
Copy link
Contributor

Should it be tied to supports.inserter? I'm typically all for more granularity so that doesn't proclude a supports.reusable but it seems safe to assume if you don't support an inserter context, you shouldn't support reusable either.

@mtias mtias added this to the WordPress 5.0 milestone Oct 23, 2018
@mtias mtias added the [Type] Task Issues or PRs that have been broken down into an individual action to take label Oct 29, 2018
@noisysocks
Copy link
Member

noisysocks commented Nov 5, 2018

Disabling Add to Reusable Blocks when supports.inserter is truthy falsey sounds 👌 to me.

@noisysocks
Copy link
Member

noisysocks commented Nov 5, 2018

Related: #7882, #10493

@noisysocks
Copy link
Member

We talked about adding supports.reusable once but decided against it in #5970.

I'd be 👌 with adding supports.reusable and making core/column and core/freeform have supports.reusable: false. It's more clear now than in April when I opened the aforementioned PR that there is a need for such a property:

  1. To disable converting Column blocks to reusable
  2. To disable converting Classic blocks to reusable, see Prevent Classic Blocks from being converted to Shared Blocks #5941
  3. To fulfil a need expressed by third party plugin developers, see Consider adding reusableBlock to the supports block configuration #4722

@ZebulanStanphill
Copy link
Member

Disabling Add to Reusable Blocks when supports.inserter is truthy sounds ok_hand to me.

I think you mean falsy?

Anyway, I would prefer a separate supports.reusable flag, given the desire to make Classic blocks unable to be saved as reusable blocks.

@noisysocks
Copy link
Member

I think you mean falsy?

Yes, I do 🙂

@mtias
Copy link
Member

mtias commented Nov 6, 2018

Let's add this, but I'm not sure about the support name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Blocks Overall functionality of blocks [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

No branches or pull requests

6 participants