-
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
Fix: Button block text alignment. #45663
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: +145 B (0%) Total Size: 1.29 MB
ℹ️ View Unchanged
|
e4f0d73
to
b60d7fd
Compare
...otherAttributes, | ||
className: classnames( | ||
otherAttributes.className, | ||
'align' + attributes.align |
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.
I think we should use literal template for consistency, how do you think?
`align${ attributes.align }`
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.
Updated 👍
b60d7fd
to
a83d534
Compare
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.
LGTM
Fixes: #44614
The button block had a block alignment control for legacy reasons added before the buttons block existed. The block alignment control does not make sense anymore when the block is nested inside buttons and does not work as expected.
This PR removes the block alignment control, and adds a new text alignment control that allows results that were not previously possible.
cc: @jasmussen
Testing
I pasted the following code on the block editor:
I verified the result in both editor and front-end of the site was this one:
I pasted the legacy button block markup on the editor:
I verified the result was this one, and there were no errors: