-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. We should never have an empty id |
||
> | ||
|
||
|
||
|
@@ -57,6 +58,7 @@ exports[`Field Message Component renders with additional attributes and classes | |
<div | ||
class="ct-field-message ct-theme-light ct-field-message--information custom-modifier" | ||
data-test="true" | ||
id="" | ||
> | ||
|
||
|
||
|
@@ -94,6 +96,7 @@ exports[`Field Message Component renders with custom theme and type 1`] = ` | |
|
||
<div | ||
class="ct-field-message ct-theme-dark ct-field-message--error " | ||
id="" | ||
> | ||
|
||
|
||
|
@@ -131,6 +134,7 @@ exports[`Field Message Component renders with default values 1`] = ` | |
|
||
<div | ||
class="ct-field-message ct-theme-light ct-field-message--information " | ||
id="" | ||
> | ||
|
||
|
||
|
@@ -168,6 +172,7 @@ exports[`Field Message Component renders with icons 1`] = ` | |
|
||
<div | ||
class="ct-field-message ct-theme-light ct-field-message--warning " | ||
id="" | ||
> | ||
|
||
|
||
|
@@ -205,6 +210,7 @@ exports[`Field Message Component strips HTML content 1`] = ` | |
|
||
<div | ||
class="ct-field-message ct-theme-light ct-field-message--information " | ||
id="" | ||
> | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,9 @@ | |
name="{{ name }}" | ||
{% if value is not empty %}value="{{ value }}"{% endif %} | ||
{% if id %}id="{{ id }}"{% endif %} | ||
{% if is_invalid and id %}aria-describedby="{{ id }}-message"{% 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Think this should be outside of the is_required attribute check |
||
{% if placeholder %}placeholder="{{ placeholder }}"{% endif %} | ||
{% if attributes is not empty %}{{- attributes|raw -}}{% endif %} | ||
/> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,9 +33,10 @@ | |
class="ct-select {{ modifier_class -}}" | ||
name="{{ name }}" | ||
{% if id %}id="{{ id }}"{% endif %} | ||
{% if is_invalid and id %}aria-describedby="{{ id }}-message"{% endif %} | ||
{% 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 commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
{% if attributes is not empty %}{{- attributes|raw -}}{% endif %} | ||
> | ||
{% for option in options %} | ||
|
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