@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

a11y: Set label instead of name for textarea aria-label value

Summary:
Prefer a field label to a field name for the aria-label parameter value of a textarea element, as that is more descriptive.

Closes T16216

Test Plan:
1. Go to http://phorge.localhost/ponder/question/edit/form/default/
2. Inspect the <textarea> tag of `Answer Summary` which now says `aria-label="Answer Summary"` instead of `aria-label="answerWiki"`
3. Go to http://phorge.localhost/maniphest/task/edit/form/default/ while having a custom text field `Custom Field` defined
4. Inspect the <textarea> tag of `Description` which now says `aria-label="Description"` instead of `aria-label="description"`
5. Inspect the <textarea> tag of `Custom Field` which now says `aria-label="Custom Field"` instead of `aria-label="std:maniphest:custom.field"`

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16216

Differential Revision: https://we.phorge.it/D26730

+8 -1
+8 -1
src/view/form/control/AphrontFormTextAreaControl.php
··· 87 87 // leading newlines if we don't do this. See T8707. 88 88 $value = "\n".$value; 89 89 90 + // Prefer the corresponding textarea "label" as "aria-label". If an element 91 + // does not have one, fall back to element "name". 92 + $aria_label = $this->getLabel(); 93 + if (!phutil_nonempty_string($aria_label)) { 94 + $aria_label = $this->getName(); 95 + } 96 + 90 97 return javelin_tag( 91 98 'textarea', 92 99 array( 93 100 'name' => $this->getName(), 94 - 'aria-label' => $this->getName(), 101 + 'aria-label' => $aria_label, 95 102 'disabled' => $this->getDisabled() ? 'disabled' : null, 96 103 'readonly' => $this->getReadOnly() ? 'readonly' : null, 97 104 'class' => $classes,