Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add functionality on inner blocks to not include parts of the UI. #18173
This PR adds functionality on InnerBlocks that allows disabling parts of the block UI.
By default, all the UI parts are still enabled.
This functionality will be used by buttons block #17352. As a follow-up, we can also refactor social links block to use this functionality, allowing us to remove some CSS hacks the block currently uses.
How has this been tested?
I tested this PR on the buttons block PR #17352. I verified all the removed UI parts don't appear inside the buttons block, and that the editor still behaves as expected.
If someday a new UI pattern
Would it be convenient to have
HI @youknowriad, that's an excellent question. My plan, for now, is not to add inheritance.
Do we expect the columns block to be different just because it is nested inside the block (B)? I don't think so, I think columns block should look the same.
I expected these flags to be used in situations where parent and child are very connected ( buttons-> button, social icons -> social icon, navigation menu -> navigation item, gallery -> image), and for these cases, it seems inheritance is not needed.
Yes, I guess a flag that is an alias for other flags makes sense. But for now, I would prefer to go this granular path. I think then we may remove granularity as maybe some flag combinations don't make sense. When we decide on the list of flags we will provide, if there are many, I guess some alias flags should be provided.
There's probably cases where you want the parent to force the experience, becoming kind of an editor provider in terms of the experience.
It might be fine to let you return false on the whole attribute as a way to disable everything instead of an object. A separate