Automattic / newspack-blocks

Gutenberg blocks for the Newspack project.
205 stars 43 forks source link

fix(ras-acc): remove unneeded aria-label from checkout-button #1873

Closed laurelfulford closed 4 weeks ago

laurelfulford commented 4 weeks ago

All Submissions:

Changes proposed in this Pull Request:

This PR removes an unnecessary aria-label attribute from the Checkout Button block -- since the button displays a text label, and the aria-label and visible button label value are the same, they're kind of redundant. (More info about `aria-label here).

It also has the nice side effect of fixing an issue where Checkout Button Blocks using inline highlight styles ended up kind of garbled.

See 1207817176293825-as-1208200566409339.

How to test the changes in this Pull Request:

  1. Starting on trunk, add some Checkout Button blocks to a page. Use the 'Highlight' style on the block toolbar to change the text colour of one of the blocks.
  2. Switch to the epic/ras-acc branch, and note how the button looks -- the <mark> tag and attributes added by the Highlight style end up inside of the aria-label attribute, mangling the HTML.

CleanShot 2024-09-04 at 14 46 05

  1. Switch to this branch.
  2. Confirm that the output of the button now looks correct:

CleanShot 2024-09-04 at 14 46 38

Other information:

laurelfulford commented 4 weeks ago

Thanks @chickenn00dle! 🙌