-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form][WCAG] Errors sign for people that do not see colors #26327
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
Conversation
The only downside is that there is no way to easily customize the chosen icon. Would it be possible to. do the same via CSS? |
Bootstrap 4 does not have any icons included. They do have 8 base64 images in their CSS but none that we can use. A way to customize the icon would be to introduce a twig block and let the user to override it. |
But that could be easily achieved on userland using CSS I guess. Bootstrap 4 does not showcase anything regarding this AFAIK, so if it's really a good practice recommended by the WCAG2, perhaps it should be fixed on bootstrap side rather than on our own by arbitrary choosing a way to make it more visual. Otherwise, I do prefer the EasyAdmin way as shown by @javiereguiluz. |
Yes, I do like that as well. Since we have that clear background and the word "error" it should be okey. |
Status: needs work |
I've added the "error badge": I need some guidance with where to put the translation for key "error". I would like to put it in the TwigBridge because that's where we use it. As alternative one could put it in the validator component. I would also like to use the "validator" domain. Any suggestions? |
Another quick comment just for your consideration. In EasyAdmin, when there are multiple errors in a single field, to avoid displaying too many But maybe this is too much attention to detail for Symfony core. Not sure. |
the repeated "ERROR" label LGTM |
@@ -244,7 +244,7 @@ | |||
<div class="{% if form is not rootform %}invalid-feedback d-block{% else %}alert alert-danger{% endif %}"> | |||
<ul class="list-unstyled mb-0"> | |||
{%- for error in errors -%} | |||
<li>{{ error.message }}</li> | |||
<li><span class="initialism form-error-icon badge badge-danger">{{ 'error'|trans }}</span> <span class="form-error-message">{{ error.message }}</span></li> |
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.
just a raw idea: instead of "error", we put that "X" unicode cross,
then we add a translation table where this "X" maps to "ERROR" in english, same in a few other languages,
but if we don't have the translation for the word "error", the cross is displayed instead - as it is more universal than "error", isn't it?
makes sense?
I've added more translations. Fabbot is a false negative. |
Thank you @Nyholm. |
… (Nyholm) This PR was squashed before being merged into the 3.4 branch (closes #26327). Discussion ---------- [Form][WCAG] Errors sign for people that do not see colors | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | According to my friend and WCAG2 expect [Sandra](https://twitter.com/sandrability): > The form errors is correctly encoded and works great. But visually they may be hard to see for people that do not see colors very well. Try to improve errors with an icon to make it more visual clear that an error has occurred.  Commits ------- 3f8cd05 [Form][WCAG] Errors sign for people that do not see colors
Great. Thank you |
…o not see colors)
…o not see colors)
…that do not see colors) (mweimerskirch) This PR was submitted for the 3.4 branch but it was merged into the 2.7 branch instead (closes #26715). Discussion ---------- Added LB translation for #26327 (Errors sign for people that do not see colors) | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | n/a | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26327 | License | MIT Commits ------- c1fae9e Added LB translation for #26327 (Errors sign for people that do not see colors)
* 2.7: [HttpCache] Unlink tmp file on error Added LB translation for #26327 (Errors sign for people that do not see colors) [TwigBridge] Fix rendering of currency by MoneyType [HttpKernel] DumpDataCollector: do not flush when a dumper is provided
* 2.8: fixed deprecated messages in tests [HttpCache] Unlink tmp file on error Added LB translation for #26327 (Errors sign for people that do not see colors) [TwigBridge] Fix rendering of currency by MoneyType [HttpKernel] DumpDataCollector: do not flush when a dumper is provided
* 3.4: (24 commits) moved Twig runtime to proper class fixed deprecated messages in tests add PHP errors options to XML schema definition [HttpCache] Unlink tmp file on error Added LB translation for #26327 (Errors sign for people that do not see colors) [TwigBridge] Fix rendering of currency by MoneyType Import InvalidArgumentException in PdoAdapter [DI] Do not suggest writing an implementation when multiple exist [Intl] Update ICU data to 61.1 Use 3rd person verb form in command description [Validator] Add Japanese translation Support phpdbg SAPI in Debug::enable() [HttpKernel] DumpDataCollector: do not flush when a dumper is provided [DI] Fix hardcoded cache dir for warmups [Routing] fix tests [Routing] Fixed the importing of files using glob patterns that match multiple resources [Ldap] cast to string when checking empty passwords [Validator] sync validator translation id [WebProfilerBundle] use the router to resolve file links no type errors with invalid submitted data types ...
* 4.0: (24 commits) moved Twig runtime to proper class fixed deprecated messages in tests add PHP errors options to XML schema definition [HttpCache] Unlink tmp file on error Added LB translation for #26327 (Errors sign for people that do not see colors) [TwigBridge] Fix rendering of currency by MoneyType Import InvalidArgumentException in PdoAdapter [DI] Do not suggest writing an implementation when multiple exist [Intl] Update ICU data to 61.1 Use 3rd person verb form in command description [Validator] Add Japanese translation Support phpdbg SAPI in Debug::enable() [HttpKernel] DumpDataCollector: do not flush when a dumper is provided [DI] Fix hardcoded cache dir for warmups [Routing] fix tests [Routing] Fixed the importing of files using glob patterns that match multiple resources [Ldap] cast to string when checking empty passwords [Validator] sync validator translation id [WebProfilerBundle] use the router to resolve file links no type errors with invalid submitted data types ...
According to my friend and WCAG2 expect Sandra: