How can I set the help text as an input placeholder on the user login form? On the user login form, I am trying to take the "help text" and make it an input placeholder (so that the help text shows up in the input and disappears when the user enters their username and password).

Here's my code:

function mymodule_form_user_login_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  $form['name']['#placeholder'] = $form['name']['#description'];
  $form['pass']['#placeholder'] = $form['pass']['#description'];
//  $form['name']['#description']['#access'] = FALSE;
//  $form['pass']['#description']['#access'] = FALSE;
}


This adds the placeholder correctly but it doesn't hide the help text, so the text appears twice (in the input and below the input).  In Drupal 7, I just set access to false, but in Drupal 8 the description is an object so I don't know what to do.
unset($form['pass']['#description']);


or

hide($form['pass']['#description']);


is probably sufficient for the description element. I wouldn't use both above on form fields/controls though, because that may lead to unwanted validation errors and so forth.



$form['name']['#description']['#access'] = FALSE;


does not work for 'description' element as it is not a form control(field).

If anybody knows of better ways for removing description element, please chime in.