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

Inputs with errors are missing aria attributes #118

Open
angelikatyborska opened this issue Mar 1, 2024 · 0 comments
Open

Inputs with errors are missing aria attributes #118

angelikatyborska opened this issue Mar 1, 2024 · 0 comments

Comments

@angelikatyborska
Copy link
Contributor

Inputs with errors should have an aria-invalid="true" attribute, as well as aria-errormessage, whose value is the id of the element with the error message.

Current output of ui_input

<label for="profile_form_street_address">
  Street address
</label>
<input
  id="profile_form_street_address"
  maxlength="255"
  name="profile_form[street_address]"
  type="text"
  value=""
>  
<span
  class="u-fg-warning"
  phx-feedback-for="profile_form[street_address]"
>
  can't be blank
</span>

Improved output of ui_input

<label for="profile_form_street_address">
  Street address
</label>
<input
  id="profile_form_street_address"
  maxlength="255"
  name="profile_form[street_address]"
  type="text"
  value=""
  aria-invalid="true"
  aria-errormessage="profile_form_street_address-help-text"
>  
<span
  id="profile_form_street_address-help-text"
  class="u-fg-warning"
  phx-feedback-for="profile_form[street_address]"
>
  can't be blank
</span>
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

No branches or pull requests

1 participant