From d534ca7b0294c26f10aa0c5588150045d259cf89 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sun, 1 Jun 2025 13:25:23 +0200 Subject: [PATCH] a11y: Add aria-label to calendar date picker button Summary: Form elements should have associated labels per https://www.w3.org/WAI/tutorials/forms/labels/ Ref T16072 Test Plan: Have a custom field of `"type": "date"` defined in `/config/edit/maniphest.custom-field-definitions/`. Go to edit a task (`/maniphest/task/edit/1/`) whose form exposes that custom field. Inspect the `` field parameters with `class="calendar-button"` and see an additional `aria-label="Calendar date picker"`. Optionally, run an Accessibility check in Chromium Lighthouse. Reviewers: O1 Blessed Committers, chris Reviewed By: O1 Blessed Committers, chris Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T16072 Differential Revision: https://we.phorge.it/D26046 --- src/view/form/control/AphrontFormDateControl.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/view/form/control/AphrontFormDateControl.php b/src/view/form/control/AphrontFormDateControl.php index 35613b3d66..8488816749 100644 --- a/src/view/form/control/AphrontFormDateControl.php +++ b/src/view/form/control/AphrontFormDateControl.php @@ -227,9 +227,10 @@ final class AphrontFormDateControl extends AphrontFormControl { $cal_icon = javelin_tag( 'a', array( - 'href' => '#', - 'class' => 'calendar-button', - 'sigil' => 'calendar-button', + 'href' => '#', + 'class' => 'calendar-button', + 'sigil' => 'calendar-button', + 'aria-label' => pht('Calendar date picker'), ), $cicon); -- 2.51.2