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

Prevent click event when buttons are aria-disabled #37577

Merged
merged 2 commits into from
Apr 5, 2023
Merged

Conversation

mdperez86
Copy link
Contributor

Submission Review Guidelines:

Changes proposed in this Pull Request:

Closes #37249

When a button is disabled it does not receives focus which disabled screen readers from announcing it. In order to solve this, we need to use aria-disabled instead and prevent any clicking event on the component to simulate the real disabled state.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Got to /wp-admin/tools.php?page=woocommerce-admin-test-helper
  2. Under Features tab make sure to enable block-editor-feature-enabled
  3. Then visit /wp-admin/admin.php?page=wc-admin&path=/add-product
  4. The header buttons should not been actionable during their disabled state

@mdperez86 mdperez86 requested a review from a team April 5, 2023 14:10
@mdperez86 mdperez86 self-assigned this Apr 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Hi , @woocommerce/mothra

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2023

Test Results Summary

Commit SHA: 55b1b3f

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 58s
E2E Tests1860010019617m 25s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Merging #37577 (55b1b3f) into trunk (2cd5cdc) will decrease coverage by 0.0%.
The diff coverage is 0.0%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             trunk   #37577     +/-   ##
==========================================
- Coverage     51.7%    51.6%   -0.0%     
  Complexity   17257    17257             
==========================================
  Files          429      429             
  Lines        79765    79770      +5     
==========================================
- Hits         41202    41201      -1     
- Misses       38563    38569      +6     
Impacted Files Coverage Δ
...oocommerce/includes/admin/class-wc-admin-menus.php 12.9% <0.0%> (-0.4%) ⬇️

... and 1 file with indirect coverage changes

Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀 Thanks for fixing this 👍

@mdperez86 mdperez86 merged commit bb22fd5 into trunk Apr 5, 2023
@mdperez86 mdperez86 deleted the fix/37249 branch April 5, 2023 16:55
@github-actions github-actions bot added this to the 7.7.0 milestone Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move the Save draft and Preview buttons to the product block header
2 participants