#60969 closed defect (bug) (fixed)
Validation of custom links in admin menu not accessible
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Menus | Keywords: | has-patch needs-testing commit has-dev-note |
Focuses: | accessibility, javascript | Cc: |
Description
When adding a custom link that doesn't meet validation, the only notification of the error is a red outline on the input field. It doesn't include any spoken notification, no property change, and the visible notification is color only.
This should include a spoken notification via wp.a11y.speak
, a property change to mark the field as invalid, and an improved visible notification.
Related: #60916
Attachments (2)
Change History (26)
#1
@
13 months ago
- Component changed from General to Menus
- Focuses accessibility javascript added
- Keywords needs-patch added
This ticket was mentioned in Slack in #core by nhrrob. View the logs.
11 months ago
This ticket was mentioned in PR #7130 on WordPress/wordpress-develop by @snehapatil02.
10 months ago
#4
- Keywords has-patch added; needs-patch removed
This pull request addresses accessibility issues related to custom link validation in the WordPress admin menu. Previously, errors were only visually indicated by a red outline on the input field, without providing sufficient spoken notifications or clear visual cues.
#### Changes Made:
- JavaScript (nav-menu.js):
- Added event listener for the "Add to Menu" button click.
- Implemented validation for the custom URL input field.
- Introduced ARIA attributes (
aria-invalid
andaria-describedby
) to indicate validation errors. - Added logic to display an error message below the input field and announce it via screen reader using
wp.a11y.speak
.
- HTML (nav-menu.php):
- Inserted a
<span>
element with an ID ofcustom-url-error
below the URL input field to display the error message.
- Inserted a
- CSS (nav-menus.css):
- Added styling for the
.error-message
class to ensure proper display of the error message.
- Added styling for the
#### Benefits:
- Improved Accessibility: By adding ARIA attributes and screen reader notifications, users with disabilities will receive clear and immediate feedback about validation errors.
- Enhanced User Experience: The error message is now prominently displayed below the input field, making it easier for all users to understand and correct validation issues.
Trac ticket: https://core.trac.wordpress.org/ticket/60969
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
9 months ago
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
8 months ago
#7
@
8 months ago
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/7130
Environment
- WordPress Playground
- WordPress: 6.7-alpha-20240803.123620
- Browser: Chrome (125.0.6422.141 (Official Build) (64-bit))
- Theme: Twenty Twenty-One
- Active Plugins:
- None
Actual Results
- x Issue is not resolved with patch.
Additional Notes
- If we have saved the custom link at first and then we remove it, it does not show any error.
Supplemental Artifacts
Before:
After:
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
7 months ago
#9
@
7 months ago
Some changes requested in the PR. See requested changes.
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
7 months ago
#11
@
7 months ago
- Milestone changed from 6.7 to 6.8
With 6.7 RC 1 releasing today this ticket is being moved to 6.8.
If any maintainer or committer feels the remaining work can be competed in time for 6.7 feel free assume ownership and update the milestone accordingly.
#12
@
4 months ago
- Keywords changes-requested added
Hello @snehapatil02 do you plan to update your PR to implement the changes proposed by @joedolson?
This ticket was mentioned in PR #8273 on WordPress/wordpress-develop by @parthvataliya.
3 months ago
#13
Trac ticket: https://core.trac.wordpress.org/ticket/60969
Add error message to URL input field under the add custom link section.
Add CSS to the error message.
parthVataliya16 commented on PR #8273:
3 months ago
#14
@joedolson I made the changes you suggested can you please review it.
Thank You!
parthVataliya16 commented on PR #8273:
3 months ago
#15
@joedolson I made the changes you suggested can you please review it.
Thank You!
@parthvataliya commented on PR #8273:
3 months ago
#16
@joedolson I made the changes you suggested can you please review it.
Thank You!
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
2 months ago
#18
@
2 months ago
Updated to extend the same accessibility improvements to custom link errors in the customizer nav menus. Also noted a pre-existing bug in the customizer nav menus error handling, where you could only trigger one error at a time due to an inappropriate if/else.
#19
@
2 months ago
- Keywords needs-testing added; changes-requested removed
To test:
1) Appearance > Menus
- Add a custom link, omitting the link field.
- Observe a visible text error, associated with the input via aria-describedby.
- Observe the output of the ARIA live announcement in wp.a11y.speak.
2) Appearance > Customizer > Menus.
- Same test; except the customizer requires text in the link text field, as well.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
2 months ago
#21
@
2 months ago
- Keywords commit needs-dev-note added
I've incorporated the same URL Regex used in the customizer to validate the content in the custom link field. With this, there is a change in how nav menus behave: previously, the customizer was stricter than the admin nav menu interface; they are now the same. There may be values that users have added in the admin that will no longer be allowed. They were never valid link structures, but that doesn't mean they don't exist.
Adding #needs-dev-note because of that change. Probably can just be part of a group note. Marking for commit; especially with this change, I think it's better to get this in earlier. We can always strip out the validation in the admin nav menus if necessary.
#23
@
8 weeks ago
Note that the dev note for this is drafted and part of the Miscellaneous Dev Note.
#24
@
7 weeks ago
- Keywords has-dev-note added; needs-dev-note removed
This has now been published as a section in the Miscellaneous developer changes in WordPress 6.8 dev note post.
As per today's bug scrub and as this ticket still needs a patch, we agreed to move it to milestone 6.7. Please feel free to move it back to 6.6 if there is ready-to-commit patch before the end of the beta phase.