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

Improve ARIA attribute handling. #355

Merged
merged 2 commits into from
Oct 25, 2021
Merged

Improve ARIA attribute handling. #355

merged 2 commits into from
Oct 25, 2021

Conversation

ndm2
Copy link
Collaborator

@ndm2 ndm2 commented Oct 16, 2021

Supporting the new ARIA attributes that are coming with 4.3 required a bit of hack here, but it could've been worse. It can be removed later once the minimum CakePHP version required by this plugin is bumped accordingly.

Adds `aria-required`, `aria-invalid`, and error element IDs for
compatibility with new ARIA attribute support added for CakePHP 4.3.

Also adds support for having the help element ID as well as the error
element ID set for `aria-describedby`. This helps to avoid losing the
association depending on a control's error state.
@codecov
Copy link

codecov bot commented Oct 16, 2021

Codecov Report

Merging #355 (504eb59) into bs5 (d57626f) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                bs5     #355      +/-   ##
============================================
+ Coverage     99.29%   99.32%   +0.02%     
- Complexity      332      353      +21     
============================================
  Files            21       21              
  Lines           994     1031      +37     
============================================
+ Hits            987     1024      +37     
  Misses            7        7              
Impacted Files Coverage Δ
src/View/Helper/FormHelper.php 99.29% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79c7de0...504eb59. Read the comment docs.

@ndm2 ndm2 merged commit 664311c into FriendsOfCake:bs5 Oct 25, 2021
*
* @var string|null
*/
private $_errorFieldName = null;
Copy link
Member

Choose a reason for hiding this comment

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

can we please use protected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could, but I made it private on purpose, as it's part of a workaround that I'd like to drop at first chance, and I don't want anyone extending the helper (I know, the likelihood is tiny) to make use of it.

@ndm2 ndm2 deleted the bs5-support branch October 26, 2021 15:35
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.

None yet

2 participants