Commit d830e59b authored by webchick's avatar webchick

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
......@@ -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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment