Open mikachan opened 1 month ago
Thanks for writing this up!
I think we have this behaviour partially implemented. But only when clicking on the inserter? I remember working on it back in https://github.com/WordPress/gutenberg/pull/37905, but it's been so long ago now, looking at that PR it's as if someone else wrote it 😆
In testing in trunk
I can see that if I click the inserter, then the styles get copied across as expected. If, however, I press the enter key to create a new button block, the behaviour to copy the block attributes does not apply. As described in this issue, I think it should. Here's how it's looking to me:
https://github.com/user-attachments/assets/39e3ca24-37d4-4c94-9f34-7bb17f5aa223
In testing in trunk I can see that if I click the inserter, then the styles get copied across as expected.
Ah yes, I can see that's how it's working for me too. So it's only if you press enter to insert a new block. I'll update the issue, thank you!
What problem does this address?
When a pattern is inserted that includes a Button block with specific styling, any additional buttons that are added when pressing
enter
after inserting the pattern do not automatically inherit the styling from the pattern. This means the new buttons do not match the intended pattern styling.For example, when inserting the Heading, Paragraph, Button with Two Images pattern and then adding more buttons next to the existing "Sign up" button, the buttons will not match the pattern styling:
(I was using TT4 theme when testing this.)
What is your proposed solution?
Add the ability for an already styled inner block to share its styling with sibling inner blocks easily, ideally automatically. We should still allow users to customise individual inner blocks as usual.