summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorDavid Smith <smithdc@gmail.com>2024-04-29 08:13:35 +0100
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-04-30 11:11:02 +0200
commitc187f5f9242b681abaa199173e02066997439425 (patch)
tree08651d3d2a3906c481483efb98c80274960b22e8 /django/forms
parent85c154da2f07485a1cdc4d886eee4c1a1ef56137 (diff)
Refs #32819 -- Avoided adding 'aria-describedby' to hidden inputs.
Hidden elements are not visible for both accessibility tools and browsers presentation layer. This change therefore only reduces the size of the generated HTML.
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/boundfield.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/django/forms/boundfield.py b/django/forms/boundfield.py
index d56fa0ea3e..d0d5c13b3d 100644
--- a/django/forms/boundfield.py
+++ b/django/forms/boundfield.py
@@ -298,6 +298,7 @@ class BoundField(RenderableFieldMixin):
and self.field.help_text
and not self.use_fieldset
and self.auto_id
+ and not self.is_hidden
):
attrs["aria-describedby"] = f"{self.auto_id}_helptext"
return attrs