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

aria-describedby not set when using data-parsley-error-message #1277

Open
1 of 3 tasks
leejacobson opened this issue Nov 12, 2018 · 5 comments
Open
1 of 3 tasks

aria-describedby not set when using data-parsley-error-message #1277

leejacobson opened this issue Nov 12, 2018 · 5 comments

Comments

@leejacobson
Copy link

What kind of issue is this? (put 'x' between the square brackets)

Example: http://jsfiddle.net/bn59odcu/

If you submit the form in the example above with two invalid email addresses the first input field will not have an aria-describedby attribute to reference the error message, but the second input will.

The issue seems to be related to using data-parsley-error-message specifically. Where we have used this attribute it is causing an accessibly issue on the project I'm working on and I assume it could be causing similar issues on other sites using Parsley. I can switch out the references to data-parsley-error-message for their error-specific alternatives for now, but it would be nice to have an official fix for this going forward.

@leejacobson
Copy link
Author

Additionally, if an input already has an aria-describedby attribute set, Parsley should append to it instead of replacing it.

As per the docs, the aria-describedby attribute supports multiple space separated IDs,
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute

@marcandre
Copy link
Collaborator

First of, thank you for the fiddle. It's much appreciated! Second, sorry for the issue you are having.

It's a curious thing. It may have to do with calling _updateError instead of _addError? I'm not sure if, or why at this point. I'm also not sure when I'll be able to have a look at it myself, but of course a PR/sponsorship is always welcome.

I also agree about the issue of appending; the two are not related though.

@WW3
Copy link

WW3 commented Nov 22, 2018

Also,

  • remove the attribute when the field gets a valid value
  • when .parsley-custom-error-message messages are visually hidden, consider also hiding from screen reader users by toggling an aria-hidden attribute

@stevenMouret
Copy link
Contributor

Fixed in my PR.

@marcandre
Copy link
Collaborator

Should be addressed correctly in 2.9.2.

Thanks for the inputs and your patience!

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

4 participants