- Issue created by @majid.ali
- Merge request !650Issue#3532327: Add alert role for better accessibility. → (Merged) created by divyansh.gupta
- 🇮🇳India divyansh.gupta Jaipur
The patch successfully applied for me the changes looks good to me because it adds accessibility to errors.
- 🇭🇺Hungary thamas Hungary
I've tested it on macOS with VoiceOver. I tried to save a webform without filling in the required fields. The screen reader announced the error message of the latest required field.
I think it's correct. But maybe it would be a good idea to have an a11y expert test the solution as well.
- leymannx Berlin
Came here very later after asking myself why the
clientside_validation
module, that already has that logic to add arole="alert"
attribute built-in (if theinline_form_errors
module is enabled) is behaving differently on Webforms.Clientside Validation module:
- Here the library gets added dynamically: https://git.drupalcode.org/project/clientside_validation/-/blob/4.1.2/cl...
- And here a wrapper with the
role="alert"
attribute gets added: https://git.drupalcode.org/project/clientside_validation/-/blob/4.1.2/cl...
But then Webform module takes over:
- Library gets added dynamically: https://git.drupalcode.org/project/webform/-/blob/6.2.9/modules/webform_...
- With its own logic and no wrapper and no
role="alert"
attribute: https://git.drupalcode.org/project/webform/-/blob/6.2.9/modules/webform_...
And because of there there's now two different logics:
- Webform have no wrapper and no role attribute
- All other forms have the errors within another wrapper which has the proper role attribute
Two thoughts on this:
- I think this should actually be fixed upstream: https://github.com/jquery-validation/jquery-validation/issues/2519
- And up until then it would be nice to at least have kinda feature parity for
webform_clientside_validation
andclientside_validation_jquery
(which even is a dependency of thewebform_clientside_validation
module), instead of overriding it. Means:webform_clientside_validation
should also add that wrapper with that role attribute.
- First commit to issue fork.
-
jrockowitz →
committed 5bda3c96 on 6.3.x authored by
divyansh.gupta →
Issue #3532527 by divyansh.gupta, majid.ali, jrockowitz, norman.lol,...
-
jrockowitz →
committed 5bda3c96 on 6.3.x authored by
divyansh.gupta →
-
jrockowitz →
committed 5bda3c96 on 6.x authored by
divyansh.gupta →
Issue #3532527 by divyansh.gupta, majid.ali, jrockowitz, norman.lol,...
-
jrockowitz →
committed 5bda3c96 on 6.x authored by
divyansh.gupta →