mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #32820 -- Added aria-invalid="true" to fields with errors.
Co-authored-by: Demetris Stavrou <demestav@gmail.com> Co-authored-by: David Smith <smithdc@gmail.com>
This commit is contained in:
committed by
Mariusz Felisiak
parent
fff14736f1
commit
10725a3187
@@ -287,6 +287,8 @@ class BoundField(RenderableFieldMixin):
|
||||
attrs["required"] = True
|
||||
if self.field.disabled:
|
||||
attrs["disabled"] = True
|
||||
if not widget.is_hidden and self.errors:
|
||||
attrs["aria-invalid"] = "true"
|
||||
# If a custom aria-describedby attribute is given (either via the attrs
|
||||
# argument or widget.attrs) and help_text is used, the custom
|
||||
# aria-described by is preserved so user can set the desired order.
|
||||
|
||||
Reference in New Issue
Block a user