From 12e61899703e963466983cc7432c08a65fc1f252 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 26 Jun 2019 20:44:25 -0700 Subject: [PATCH] signup, settings: Update password strength meter on input events. Pasting a generated password into the password box triggers neither a change event (until the password box is unfocused) nor a keyup event. Signed-off-by: Anders Kaseorg --- static/js/portico/signup.js | 2 +- static/js/settings_account.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/portico/signup.js b/static/js/portico/signup.js index dd66f9122f..e39684878f 100644 --- a/static/js/portico/signup.js +++ b/static/js/portico/signup.js @@ -13,7 +13,7 @@ $(function () { // was just reloaded due to a validation failure on the backend. common.password_quality(password_field.val(), $('#pw_strength .bar'), password_field); - password_field.on('change keyup', function () { + password_field.on('input', function () { // Update the password strength bar even if we aren't validating // the field yet. common.password_quality($(this).val(), $('#pw_strength .bar'), $(this)); diff --git a/static/js/settings_account.js b/static/js/settings_account.js index b6fb153002..2d45a33f72 100644 --- a/static/js/settings_account.js +++ b/static/js/settings_account.js @@ -372,7 +372,7 @@ exports.set_up = function () { }); }); - $('#new_password').on('change keyup', function () { + $('#new_password').on('input', function () { var field = $('#new_password'); common.password_quality(field.val(), $('#pw_strength .bar'), field); });