Skip to content
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

Button Block Alignment fix #67796

Open
wants to merge 9 commits into
base: trunk
Choose a base branch
from

Conversation

karthick-murugan
Copy link
Contributor

What?

Fixes #61085

This PR resolves an issue with the Button Block alignment and justification options, where the default styles for "Justify items left" and "Align top" were not correctly applied. The fix ensures that the selected options are consistently applied and displayed as expected.

Why?

This PR is necessary to ensure that users can properly align and justify Button blocks within Gutenberg. The existing issue prevented the correct display of the button alignment and justification styles. When the "Justify items left" and "Align top" options were selected, the expected visual changes were not reflected. This fix improves the user experience by ensuring these options work as intended.

How?

The issue was fixed by adding custom CSS to target the active state of menu items in the dropdown, specifically for the Button block alignment and justification styles. The is-active class now correctly applies the styles, ensuring that "Justify items left" and "Align top" options are visually reflected in the Button block.

Testing Instructions

Test the Button Block Alignment and Justification:

  • Open a post or page in the Gutenberg editor.
  • Add a Button block to the page.
  • Change the button’s justification to "Justify items left" and the alignment to "Align Top."
  • Ensure that the Button block now displays the selected justification and alignment options correctly.

Check for Visual Changes:

  • Confirm that the button is aligned to the left and aligned to the top as selected in the block settings.
  • Verify that the styles for both alignment and justification are applied as expected.

Screenshots or screencast

REC-20241210204828.mp4

Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: karthick-murugan <[email protected]>
Co-authored-by: talldan <[email protected]>
Co-authored-by: jasmussen <[email protected]>
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: murshed <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Block] Buttons Affects the Buttons Block labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tricky issue with the Gutenberg Button Block Alignment and Justification option select style
2 participants