Skip to content
Snippets Groups Projects
Commit d830e59b authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2467863 by Dom., JesseSturgis, mgifford, LewisNyman, Cliff,...

Issue #2467863 by Dom., JesseSturgis, mgifford, LewisNyman, Cliff, benjifisher, heatherwoz, crasx: Login form's aria-describeby points to an element that doesn't exist
parent aa991be0
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -90,8 +90,13 @@ protected function blockAccess(AccountInterface $account) {
public function build() {
$form = \Drupal::formBuilder()->getForm('Drupal\user\Form\UserLoginForm');
unset($form['name']['#attributes']['autofocus']);
// When unsetting field descriptions, also unset aria-describedby attributes
// to avoid introducing an accessibility bug.
// @todo Do this automatically in https://www.drupal.org/node/2547063.
unset($form['name']['#description']);
unset($form['name']['#attributes']['aria-describedby']);
unset($form['pass']['#description']);
unset($form['pass']['#attributes']['aria-describedby']);
$form['name']['#size'] = 15;
$form['pass']['#size'] = 15;
$form['#action'] = $this->url('<current>', [], ['query' => $this->getDestinationArray(), 'external' => FALSE]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment