By utkarsh_33 on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
11.x
Introduced in version:
11.x
Issue links:
Description:
The confirm_password element has been deprecated, and a new element named password_unmask, element class core/lib/Drupal/Core/Render/Element/PasswordUnmask.php has been introduced to enhance the user experience for password fields.
The password_unmask element allows users to reveal their password and also customize the inclusion of show password strength indicator.
The new element includes the ability to toggle password visibility.The attribute 'data-drupal-strength-indicator' allows the user to include the strength indicator by setting it to TRUE which is by default set to FALSE.
Code usage
* $form['pass'] = array(
* '#type' => 'password_unmask',
* '#title' => t('Password'),
* '#size' => 25,
* );
Old

New

| Attachment | Size |
|---|---|
| New behaviour | 58.67 KB |
| Old behaviour | 64.29 KB |