Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Core: Unnecessary aria-describedby#2410

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@eden-jh
Copy link
Contributor

@eden-jheden-jh commentedNov 16, 2021
edited
Loading

Apologies for the messy commit history. I squashed it (eden-jh@73a70d2) but then it forced me to merge before pushing.

Description

I added anariaDescribedByCleanup option to the validator setting. The default is false just to keep the current behavior (leave the value in place but empty and hide the error elements). I don't feel strongly about that, but it felt safer to make this opt-in, especially because there's a certain amount of customization that needs to happen in order for this to be a problem.

Fixes#2094 (kind of; the examples given in the issue are from unobtrusive, and the default is the current behavior, the setting will have to be updated in unobtrusive.)

Added additional tests for this functionality, plus a demo page.

Groups

aria-describedby is used on all group elements if any of them has an error, and is only removed when all elements in that group are valid. This seemed the most consistent with the current functionality.

jhaysODPS reacted with thumbs up emoji
eden-jhand others added15 commitsNovember 2, 2021 17:33
Ensure that aria-describedby is removed from all members of a group when all the known errors are resolved
Includes additional unit tests and a demo page
@github-actions
Copy link

This issue/proposal has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automatically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up.
Thank you for contributing :)

@github-actionsgithub-actionsbot added the staleUsed to mark stale issues labelApr 15, 2022
@bytestreambytestream reopened thisMay 8, 2024
@bytestreambytestream added NEEDS REVIEW and removed staleUsed to mark stale issues labelsMay 8, 2024
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds an optionalariaDescribedByCleanup setting to the jQuery Validation Plugin that controls whetheraria-describedby attributes are removed from form fields when they become valid. The default is false to maintain current behavior.

  • Introduces newariaDescribedByCleanup setting (defaults to false)
  • Refactors aria-describedby management into dedicated helper methods
  • Adds comprehensive test coverage for the new functionality including group behavior

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
src/core.jsCore implementation of aria-describedby cleanup functionality with new helper methods
test/error-placement.jsComprehensive test coverage for the new cleanup behavior
test/index.htmlTest form markup for aria-describedby cleanup scenarios
demo/aria-describedby-cleanup.htmlDemo page showcasing the new functionality
demo/css/cmxform.cssCSS updates to support demo layout with flexbox styling
demo/css/cmxformTemplate.cssTemplate CSS updates for consistent box styling
demo/index.htmlAdded link to the new demo page

Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.

if(testgroup===group&&name!==checkElement.name){
cleanElement=v.validationTargetFor(v.clean(v.findByName(name)));

// Don't want to check fields if a user hasn't gotten to them yet
Copy link

CopilotAIOct 3, 2025

Choose a reason for hiding this comment

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

[nitpick] This comment is unclear about what 'a user hasn't gotten to them yet' means in this context. Consider clarifying what condition this refers to or removing if it's not adding value.

Suggested change
//Don't want tocheck fieldsif auserhasn't gotten to them yet
//Onlycheck fieldsthat have already been marked as invalid (i.e.,userhas interacted with them)

Copilot uses AI. Check for mistakes.
Comment on lines +649 to +650

for(vari=0;errors[i];i++){
Copy link

CopilotAIOct 3, 2025

Choose a reason for hiding this comment

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

[nitpick] Using a for loop with array access pattern instead of jQuery's .each() method is inconsistent with the rest of the codebase style. Consider usingerrors.each(function(i, error) { ... }) for consistency.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bytestreambytestream changed the titleCore: Unnecessary aria-describedby (makes #2094 fixable)Core: Unnecessary aria-describedbyOct 3, 2025
@bytestreambytestream merged commit6eb2df0 intojquery-validation:masterOct 3, 2025
3 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Unnecessary aria-describedby attribute causes WCAG scans to fail

2 participants

@eden-jh@bytestream

[8]ページ先頭

©2009-2025 Movatter.jp