Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4816917
D26051.1749283660.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D26051.1749283660.diff
View Options
diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
--- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
+++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
@@ -451,6 +451,7 @@
$action_select = id(new AphrontFormSelectControl())
->addClass('phui-comment-fullwidth-control')
->addClass('phui-comment-action-control')
+ ->setAriaLabel(pht('Comment Action Options'))
->setID($action_id)
->setOptions($options);
diff --git a/src/view/form/control/AphrontFormControl.php b/src/view/form/control/AphrontFormControl.php
--- a/src/view/form/control/AphrontFormControl.php
+++ b/src/view/form/control/AphrontFormControl.php
@@ -3,6 +3,7 @@
abstract class AphrontFormControl extends AphrontView {
private $label;
+ private $ariaLabel;
private $caption;
private $error;
private $name;
@@ -52,6 +53,20 @@
return $this;
}
+ /**
+ * Explicitly set an aria-label attribute for accessibility. Only to be used
+ * when no visible label is already set via setLabel().
+ * @param string $aria_label aria-label text to add to the form control
+ */
+ public function setAriaLabel($aria_label) {
+ $this->ariaLabel = $aria_label;
+ return $this;
+ }
+
+ public function getAriaLabel() {
+ return $this->ariaLabel;
+ }
+
public function getLabel() {
return $this->label;
}
diff --git a/src/view/form/control/AphrontFormSelectControl.php b/src/view/form/control/AphrontFormSelectControl.php
--- a/src/view/form/control/AphrontFormSelectControl.php
+++ b/src/view/form/control/AphrontFormSelectControl.php
@@ -28,9 +28,10 @@
$this->getValue(),
$this->getOptions(),
array(
- 'name' => $this->getName(),
- 'disabled' => $this->getDisabled() ? 'disabled' : null,
- 'id' => $this->getID(),
+ 'name' => $this->getName(),
+ 'disabled' => $this->getDisabled() ? 'disabled' : null,
+ 'id' => $this->getID(),
+ 'aria-label' => $this->getAriaLabel(),
),
$this->disabledOptions);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 7, 08:07 (11 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1754024
Default Alt Text
D26051.1749283660.diff (2 KB)
Attached To
Mode
D26051: a11y: Set aria-label for comment action options dropdown
Attached
Detach File
Event Timeline
Log In to Comment