-
Notifications
You must be signed in to change notification settings - Fork 6
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
[#378] Fixed error message with screen reader. #439
base: main
Are you sure you want to change the base?
Conversation
@@ -29,8 +29,9 @@ | |||
name="{{ name }}" | |||
value="{{ value }}" | |||
id="{{ id }}" | |||
{% if is_invalid and id %}aria-describedby="{{ id }}-message"{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work with Drupal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ie seems like we would need to pass the entire ID of the message block at the top of the screen
@@ -7,6 +7,7 @@ exports[`Field Message Component allows HTML content 1`] = ` | |||
|
|||
<div | |||
class="ct-field-message ct-theme-light ct-field-message--information " | |||
id="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never have an empty id
{% if is_disabled %}disabled{% endif %} | ||
{% if is_required %}required{% endif %} | ||
{% if is_required %}required aria-invalid="{{ is_invalid ? is_invalid : 'false' }}"{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is not invalid why do we want to add this attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this should be outside of the is_required attribute check
{% if is_multiple %}multiple{% endif %} | ||
{% if is_disabled %}disabled{% endif %} | ||
{% if is_required %}required{% endif %} | ||
{% if is_required %}required aria-invalid="{{ is_invalid ? is_invalid : 'false' }}"{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@febdao I have some questions about the use of aria-invalid and its position within the component
Fixed: #378
Jira ticket:
Checklist before requesting a review
as
[#123] Verb in past tense with a period at the end.
Changed
section about WHY something wasdone if this was a bespoke implementation.
and they have passed.
Changed
Screenshots