-
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
Update defaults for Home Link block #58307
Comments
I was wondering why this wasn't done via an attribute default when the block was created in the first place. Maybe it's the i18n? I.e. the
(I'm not sure if we have a mechanism to support localized strings like that in |
Looks like this is the authoritative source of what No attribute defaults in that one. So that might explain why this was done on the editor side in the first place 😬 |
Thanks @ockham! I suspected it may have something to do with translations. Maybe instead of setting the attribute if there isn't one, we can render |
That sounds like a good idea! It would basically reflect the behavior in the editor, and allow inclusion of a Home Link block with no attributes set 👍 |
Post-scriptum, looks like it was actually discussed at the time: https://github.com/WordPress/gutenberg/pull/30293/files#r619407489 |
Description
It's now possible to use the Block Hooks API to insert inner blocks into the core Navigation block #57754. Using this API currently doesn't allow you to set attributes along with the hooked block.
We found that when you use the API to insert the
core/home-link
block it has insufficient default attributes. When we insert this block via the API we can't set any attributes and one of the conditions for this block to render server-side is a label attribute, see here.When you insert the block via the editor, this gets added on the client-side. See here.
Step-by-step reproduction instructions
core/home-link
tocore/loginout
in the snippet below to see a block rendering correctly as comparison.Screenshots, screen recording, code snippet
No response
Environment info
trunk
or 17.6 and above.Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: