-
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
Inner blocks: try hook approach #25633
Conversation
Size Change: +57 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
Shouldn't it be |
Yeah, definitely with -s, typo :) |
Yeah, that I think that's better. That's why I also preferred |
@ellatrix It makes sense to me. One thing though about the "block wrapper" hook, is how to "validate" that it's actually applied to the wrapper element of the block or if there's any way to do it. |
Do you mean checking if it's attached to an element at all, or checking if it's attached to the outer element. |
Aside some "framework provided features" (like the alignment maybe), I think the block wrapper should always be on the outer element, there's a lot of assumptions in the code of the block editor that is based on that, we can't render anything there. |
We could check in the DOM if the parent node is a block list. |
17a95f9
to
db336ab
Compare
Just 1 e2e test case failure in writing flow with columns... not sure what the cause is. |
@ellatrix In the failing test, there's a part where you're in Navigation mode and you press down to navigate from one Column to the next, and then right to get to a nested Paragraph. However, if you press right too quickly, you stay on the Column. I've also noticed that, for some reason, moving from the first Column to the second seems to take a bit longer than moving from the second Column to its nested Paragraph. As it turns out, in the same file, there's a comment inside the |
Strange that it's failing for this particular branch though. |
@ellatrix I guess it implies this branch has introduced a performance hit somewhere that is causing the test to start failing? Not really sure. Either way, it's kind of weird that keyboard input is effectively ignored if you do it too quickly. That sounds like a bug that should be fixed. |
Yeah it works in slowmo... |
Hm, and sometimes it passes locally, sometimes not. :) |
Failed at finding the cause today. I'll resume looking tomorrow. |
0fc8d06
to
fa59374
Compare
I can't figure out why these two tests are not passing. |
OMG! I'm pretty sure it's |
Finally, it passes 🎉 |
36b9c27
to
672c67c
Compare
d11c1b6
to
c49c73d
Compare
Description
New experimental API.
Currently,
<InnerBlocks />
renders a wrapper, but<InnerBlocks.Content>
doesn't. Instead, we have to allow customising the wrapper tag name props through the__experimentalTagName
and__experimentalPassedProps
props.Currently:
With a hook:
Allowing the block author to render the block wrapper gives some more freedom.
You can now render something before or after the content:
In the future, we could allow more control over the children:
How has this been tested?
Screenshots
Types of changes
Checklist: