diff --git a/src/wp-admin/js/user-profile.js b/src/wp-admin/js/user-profile.js
index 7ebdd77..b713180 100644
a
|
b
|
|
15 | 15 | $toggleButton, |
16 | 16 | $submitButtons, |
17 | 17 | $submitButton, |
18 | | currentPass; |
| 18 | currentPass, |
| 19 | |
| 20 | inputEvent; |
| 21 | |
| 22 | /** |
| 23 | * Detect whether password inputs should use the keyup |
| 24 | * or input event. Input is preferred but lacking support |
| 25 | * in legacy browsers. |
| 26 | * |
| 27 | * @ticket 33398 |
| 28 | */ |
| 29 | if ( 'oninput' in document.createElement('input') ) { |
| 30 | inputEvent = 'input'; |
| 31 | } |
| 32 | else { |
| 33 | inputEvent = 'keyup'; |
| 34 | } |
19 | 35 | |
20 | 36 | function generatePassword() { |
21 | 37 | if ( typeof zxcvbn !== 'function' ) { |
… |
… |
|
47 | 63 | .addClass( $pass1[0].className ) |
48 | 64 | .data( 'pw', $pass1.data( 'pw' ) ) |
49 | 65 | .val( $pass1.val() ) |
50 | | .on( 'keyup', function () { |
| 66 | .on( inputEvent, function () { |
51 | 67 | if ( $pass1Text.val() === currentPass ) { |
52 | 68 | return; |
53 | 69 | } |
… |
… |
|
62 | 78 | generatePassword(); |
63 | 79 | } |
64 | 80 | |
65 | | $pass1.on( 'keyup pwupdate', function () { |
| 81 | $pass1.on( inputEvent + ' pwupdate', function () { |
66 | 82 | if ( $pass1.val() === currentPass ) { |
67 | 83 | return; |
68 | 84 | } |
… |
… |
|
165 | 181 | * This fixes the issue by copying any changes from the hidden |
166 | 182 | * pass2 field to the pass1 field, then running check_pass_strength. |
167 | 183 | */ |
168 | | $pass2 = $('#pass2').on( 'keyup', function () { |
| 184 | $pass2 = $('#pass2').on( inputEvent, function () { |
169 | 185 | if ( $pass2.val().length > 0 ) { |
170 | 186 | $pass1.val( $pass2.val() ); |
171 | 187 | $pass2.val(''); |
… |
… |
|
246 | 262 | var $colorpicker, $stylesheet, user_id, current_user_id, |
247 | 263 | select = $( '#display_name' ); |
248 | 264 | |
249 | | $('#pass1').val('').on( 'keyup pwupdate', check_pass_strength ); |
| 265 | $('#pass1').val('').on( inputEvent + ' pwupdate', check_pass_strength ); |
250 | 266 | $('#pass-strength-result').show(); |
251 | 267 | $('.color-palette').click( function() { |
252 | 268 | $(this).siblings('input[name="admin_color"]').prop('checked', true); |