diff options
Diffstat (limited to 'src/js/_enqueues')
-rw-r--r-- | src/js/_enqueues/admin/user-profile.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/js/_enqueues/admin/user-profile.js b/src/js/_enqueues/admin/user-profile.js index ad808d3131..ce680ef4c4 100644 --- a/src/js/_enqueues/admin/user-profile.js +++ b/src/js/_enqueues/admin/user-profile.js @@ -101,6 +101,8 @@ return; } $toggleButton = $pass1Row.find('.wp-hide-pw'); + + // Toggle between showing and hiding the password. $toggleButton.show().on( 'click', function () { if ( 'password' === $pass1.attr( 'type' ) ) { $pass1.attr( 'type', 'text' ); @@ -110,6 +112,14 @@ resetToggle( true ); } }); + + // Ensure the password input type is set to password when the form is submitted. + $pass1Row.closest( 'form' ).on( 'submit', function() { + if ( $pass1.attr( 'type' ) === 'text' ) { + $pass1.attr( 'type', 'password' ); + resetToggle( true ); + } + } ); } /** |