-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Make the inner button block not allowed as a reusable block or editable as HTML #20948
Conversation
Size Change: -102 B (0%) Total Size: 857 kB
ℹ️ View Unchanged
|
@@ -33,6 +33,8 @@ export const settings = { | |||
supports: { | |||
align: true, | |||
alignWide: false, | |||
reusable: false, | |||
html: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this change affects mobile in the index.native.js file, so was wondering what the best way to update this setting on mobile would be (cc @pinarol)?
Is it best to keep the mobile setting as it currently is ... e.g.:
export const settings = {
...webSettings,
supports: {
align: true,
alignWide: false,
},
parent: undefined,
};
I agree with the reusable bit, but not sure about the edit as HTML. Why shouldn't that be possible? |
@mtias I noticed this was on other blocks with a parent, but it looks like I've made a bad assumption. It's specified on the Column block because of that being a parent block (#11785) and specified on the Navigation Link and Social Link blocks because those are dynamic blocks (#19483). So I've changed that again, the button can now be edited as html (74d3707). |
Great, thanks, that makes more sense. |
Description
Fixes #20942, which identifies that the button block can be made reusable, but then attempting to convert that reusable button block to a regular block outside of its parent context fails.
This PR makes the Button block consistent with other inner blocks (navigation link, social icons, column) with a distinct parent. Those blocks generally can't be made reusable, because of the above issue. They also generally can't be edited as HMTL. The general idea is that the parent has those options but the child doesn't.
With the Button block, there is a the possibility that this block is already in use in some reusable blocks and those still can't be converted to regular blocks, that's something this PR doesn't solve.
How has this been tested?
Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: