diff -u b/core/lib/Drupal/Core/Render/Element/PasswordReveal.php b/core/lib/Drupal/Core/Render/Element/PasswordReveal.php --- b/core/lib/Drupal/Core/Render/Element/PasswordReveal.php +++ b/core/lib/Drupal/Core/Render/Element/PasswordReveal.php @@ -47,6 +47,7 @@ $element['#attributes']['class'][] = 'js-password-field'; $element['#attached']['library'][] = 'core/drupal.revealpass'; $element['#attributes']['data-drupal-revealpass'] = TRUE; + $element['#attributes']['data-drupal-password-strength'] = TRUE; return $element; } diff -u b/core/misc/revealpass.js b/core/misc/revealpass.js --- b/core/misc/revealpass.js +++ b/core/misc/revealpass.js @@ -31,6 +31,19 @@ } /** + * Create reveal button and bind event. + * + * @param {number} index + * @param {HTMLElement} element + */ + function revealLink(index, element) { + var $trigger = $(''); + + $trigger.on('click', {password: element}, revealClickHandle); + $trigger.insertAfter(element); + } + + /** * Initialize reveal links. * * @type {Drupal~behavior} @@ -39,12 +52,7 @@ attach: function (context) { $(context).find('input[type=password][data-drupal-revealpass]') .once('revealpass') - .each(function (index, element) { - var $trigger = $(''); - - $trigger.on('click', {password: element}, revealClickHandle); - $trigger.insertAfter(element); - }); + .each(revealLink); } }; diff -u b/core/modules/user/user.js b/core/modules/user/user.js --- b/core/modules/user/user.js +++ b/core/modules/user/user.js @@ -31,20 +31,15 @@ // Add identifying class to password element parent. $passwordInputParent.addClass('password-parent'); - var passwordSelector = 'js-password-field'; - // If there is a password confirm field use that. - if ($(context).find('input.js-password-confirm').length) { - passwordSelector = 'js-password-confirm'; - } // Add the password confirmation layer. $passwordInputParentWrapper - .find('input.' + passwordSelector) + .find('input[data-drupal-password-strength]') .parent() .append('